<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Gettng a refresh token from GetAuthorizeUri in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/598525#M2617</link>
    <description>&lt;P&gt;Hi, I am trying to convert my .net code (used for the old non expiring tokens) to get a refresh token.&lt;/P&gt;&lt;P&gt;In this part:&lt;/P&gt;&lt;P&gt;var authorizeUri = DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType.Token, appKey, new Uri(RedirectUri), this.oauth2State);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where do I specify looking for an offline request? (&lt;SPAN&gt;token_access_type=offline)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 21 May 2022 20:22:50 GMT</pubDate>
    <dc:creator>phunction</dc:creator>
    <dc:date>2022-05-21T20:22:50Z</dc:date>
    <item>
      <title>Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/598525#M2617</link>
      <description>&lt;P&gt;Hi, I am trying to convert my .net code (used for the old non expiring tokens) to get a refresh token.&lt;/P&gt;&lt;P&gt;In this part:&lt;/P&gt;&lt;P&gt;var authorizeUri = DropboxOAuth2Helper.GetAuthorizeUri(OAuthResponseType.Token, appKey, new Uri(RedirectUri), this.oauth2State);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where do I specify looking for an offline request? (&lt;SPAN&gt;token_access_type=offline)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 21 May 2022 20:22:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/598525#M2617</guid>
      <dc:creator>phunction</dc:creator>
      <dc:date>2022-05-21T20:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/598544#M2618</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Good reference point could be &lt;A href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/main/dropbox-sdk-dotnet/Examples/OAuthPKCE/Program.cs#L184" target="_blank" rel="noopener"&gt;one of the examples&lt;/A&gt;. On the enlightened line take a look at "tokenAccessType: TokenAccessType.Offline". &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sun, 22 May 2022 00:06:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/598544#M2618</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-05-22T00:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599021#M2626</link>
      <description>&lt;P&gt;Thanks, I am trying to use this in Xamarin.iOS using a webview. I am unable to find any examples of this when it comes to getting a refresh token (offline access type), it works fine the older way but that of course only gives the very temporary token.&lt;/P&gt;&lt;P&gt;Any hints would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess my main goal is how do I present a login screen in my app so the user can login to dropbox and I can then use that to get the refresh token.&amp;nbsp; Is there a way they can just authorize my app so I don't have to deal with the login part? Since they already logged into the actual drop box app.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 19:37:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599021#M2626</guid>
      <dc:creator>phunction</dc:creator>
      <dc:date>2022-05-23T19:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599054#M2627</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt; As Здравко indicated, setting tokenAccessType: TokenAccessType.Offline on GetAuthorizeUri is the right way to request offline access in order to get a refresh token, as shown in the example they linked to. You can find &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/gh-pages/obj/api/Dropbox.Api.DropboxOAuth2Helper.html#Dropbox_Api_DropboxOAuth2Helper_GetAuthorizeUri_Dropbox_Api_OAuthResponseType_System_String_System_String_System_String_System_Boolean_System_Boolean_System_String_System_Boolean_Dropbox_Api_TokenAccessType_System_String___Dropbox_Api_IncludeGrantedScopes_System_String_" target="_self"&gt;the full options for GetAuthorizeUri in the documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please note that unfortunately the Dropbox .NET SDK isn't officially supported for Xamarin, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, the OAuth app authorization flow should be processed in the user's system browser, not a web view. See here for more information: &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#oauth2-authorize&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 20:35:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599054#M2627</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-05-23T20:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599069#M2628</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&amp;nbsp; Is there a way they can just authorize my app so I don't have to deal with the login part? ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt;&amp;nbsp; take a look on the &lt;A title="refresh token" href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/main/dropbox-sdk-dotnet/Examples/OAuthPKCE/Program.cs#L204" target="_blank" rel="noopener"&gt;line&lt;/A&gt; where refresh token is referred to. Once you got to this token, next time you can skip actual login part and process directly the client creation. Owning the token keeps you (your application actually) logged in corresponding account, where you have logged in already before. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp; may be a good idea new feature providing serialization/deserialization of current client tokens status. This would provide an easier way for managing most recent state (keep/restore). Is .NET SDK the only kit that missing this feature? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 22:20:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599069#M2628</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-05-23T22:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599083#M2629</link>
      <description>&lt;P&gt;Thanks for the help, I am now able to get the refresh token, but I am unable to list files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I normally listed the files like this:&lt;/P&gt;&lt;P&gt;DropboxClient&amp;nbsp;dbx = new DropboxClient(szToken);&amp;nbsp; &amp;lt;-&amp;nbsp; previous just using access token&lt;/P&gt;&lt;P&gt;var list = await dbx.Files.ListFolderAsync(string.Empty);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I changed this part:&lt;/P&gt;&lt;P&gt;DropboxClient&amp;nbsp;dbx = new DropboxClient(szRefreshToken,appKey);&lt;/P&gt;&lt;P&gt;but when I try the dbx.Files I get an exception of:&amp;nbsp;"Response status code does not indicate success: 400 (Bad Request)."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 23:59:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599083#M2629</guid>
      <dc:creator>phunction</dc:creator>
      <dc:date>2022-05-23T23:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599090#M2630</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;I changed this part:&lt;/P&gt;&lt;P&gt;DropboxClient&amp;nbsp;dbx = new DropboxClient(szRefreshToken,appKey);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;What type of authentication flow have you selected in your application? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Take in mind that constructor overriding, used by you, is applicable only with PKCE flow! If you are using something else, on access token request Dropbox expects the application secret too. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Does this fix your last issue?&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 00:22:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599090#M2630</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-05-24T00:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599094#M2631</link>
      <description>&lt;P&gt;Thanks, adding the app secret to the client request worked.&lt;/P&gt;&lt;P&gt;When you say what authentication flow I have selected, do you mean in the dropbox app console?&lt;/P&gt;&lt;P&gt;I am unable to find a setting for that.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 00:55:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599094#M2631</guid>
      <dc:creator>phunction</dc:creator>
      <dc:date>2022-05-24T00:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599101#M2632</link>
      <description>&lt;P&gt;No, no,... That's not a setting either on your application in console or anything else. It's the workflow on authorization supported by Dropbox and selected by you eventually. As an example, again on the same file, take a look &lt;A title="PKCE Flow" href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/main/dropbox-sdk-dotnet/Examples/OAuthPKCE/Program.cs#L183" target="_blank" rel="noopener"&gt;here&lt;/A&gt;. You can see example of PKCE usage. You have used something similar on initial authentication. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; What actually? 🧐 That's it. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies matter.&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 01:08:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599101#M2632</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-05-24T01:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599262#M2633</link>
      <description>&lt;P&gt;Interesting, I don't actually specify that, I am using whatever this uses:&lt;/P&gt;&lt;P&gt;DropboxOAuth2Helper.GetAuthorizeUri&lt;/P&gt;&lt;P&gt;But I have not been able to find what that is defaulting to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, just to double check, once I have the refresh token, I just need to keep reusing that and it will not expire for a while?&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 17:30:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599262#M2633</guid>
      <dc:creator>phunction</dc:creator>
      <dc:date>2022-05-24T17:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: Gettng a refresh token from GetAuthorizeUri</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599264#M2634</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/324915"&gt;@phunction&lt;/a&gt; You can find the default parameter values for GetAuthorizeUri in &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/gh-pages/obj/api/Dropbox.Api.DropboxOAuth2Helper.html#Dropbox_Api_DropboxOAuth2Helper_GetAuthorizeUri_Dropbox_Api_OAuthResponseType_System_String_System_String_System_String_System_Boolean_System_Boolean_System_String_System_Boolean_Dropbox_Api_TokenAccessType_System_String___Dropbox_Api_IncludeGrantedScopes_System_String_" target="_self"&gt;the documentation here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And that's correct, you can re-use refresh tokens; refresh tokens don't expire by themselves (though they can be revoked by the app or user on demand).&lt;/P&gt;</description>
      <pubDate>Tue, 24 May 2022 17:35:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Gettng-a-refresh-token-from-GetAuthorizeUri/m-p/599264#M2634</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-05-24T17:35:03Z</dc:date>
    </item>
  </channel>
</rss>

