<?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 Re: Java SDK:  authorizing with a refresh token, getting &amp;quot;no auth function available for given in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612686#M28329</link>
    <description>&lt;P&gt;Since you're not using PKCE, the app secret is required for the refresh process, so you'll need to set appSecret when making your &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v5.3.0/com/dropbox/core/oauth/DbxCredential.html#%3Cinit%3E(java.lang.String,java.lang.Long,java.lang.String,java.lang.String,java.lang.String)" target="_self"&gt;DbxCredential​&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 19:56:41 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2022-07-28T19:56:41Z</dc:date>
    <item>
      <title>Java SDK:  authorizing with a refresh token, getting "no auth function available for given request"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612683#M28328</link>
      <description>&lt;P&gt;I'm trying to get authorization using refresh token to work in my project, but I'm having some trouble. This is a command line tool that will run as a cron job, so there shouldn't be any user interaction except once when setting up the configuration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I start by maunally going to an authorization URL in a browser:&lt;BR /&gt;&lt;A href="https://www.dropbox.com/oauth2/authorize?client_id=" target="_blank" rel="noopener"&gt;https://www.dropbox.com/oauth2/authorize?client_id=&lt;/A&gt;&amp;lt;removed for security&amp;gt;&amp;amp;response_type=code&amp;amp;token_access_type=offline&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There, I authorize the app and get a code. Then I run the following Groovy script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;String appKey = '&amp;lt;removed for security&amp;gt;'
String appSecret = '&amp;lt;removed for security&amp;gt;'

DbxAppInfo appInfo = new DbxAppInfo(appKey, appSecret)

String accessCode = '&amp;lt;the code I got from the website&amp;gt;' 

DbxRequestConfig config = DbxRequestConfig.newBuilder(appKey).build();
DbxWebAuth webAuth = new DbxWebAuth(config, appInfo)
DbxAuthFinish authFinish = webAuth.finishFromCode(accessCode)
println authFinish.getAccessToken()
println authFinish.getRefreshToken()
println authFinish.getScope() // Returns account_info.read files.content.read files.metadata.read sharing.read sharing.write&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That works fine, and I get an access token (which I don't think I should need since I'll be using the refresh token) and a refresh token.&lt;/P&gt;
&lt;P&gt;I use those in this script, which is testing some of what the final product will need to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;String folderUrl = '&amp;lt;the URL of a shared folder&amp;gt;'

String appKey = '&amp;lt;our app key&amp;gt;'
String accessToken = '&amp;lt;the access token retrieved in the previous script&amp;gt;'
String refreshToken = '&amp;lt;the refresh token retrieved in the previous script&amp;gt;'

DbxRequestConfig config = DbxRequestConfig.newBuilder(appKey).build();
DbxCredential credential = new DbxCredential(accessToken, 1, refreshToken, appKey)
DbxClientV2 client = new DbxClientV2(config, credential);

FolderLinkMetadata metadata = client.sharing().getSharedLinkMetadata(folderUrl)
println metadata&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(There's actually more of that script, but for the sake of simplicity I truncated it where the error happens.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On the getSharedLinkMetadata call, I get com.dropbox.core.oauth.DbxOAuthException: No auth function available for given request. Searching for that exception on Google, it seems to be pretty generic, so I'm not sure what the specific problem is.&lt;BR /&gt;Note that this works if, instead of a refresh token, I use an access token that I generate on the app console web page.&lt;BR /&gt;Are there any problems with how I'm doing this? If not, how should I begin troubleshooting?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 22:15:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612683#M28328</guid>
      <dc:creator>TC888</dc:creator>
      <dc:date>2022-07-28T22:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK:  authorizing with a refresh token, getting "no auth function available for given</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612686#M28329</link>
      <description>&lt;P&gt;Since you're not using PKCE, the app secret is required for the refresh process, so you'll need to set appSecret when making your &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v5.3.0/com/dropbox/core/oauth/DbxCredential.html#%3Cinit%3E(java.lang.String,java.lang.Long,java.lang.String,java.lang.String,java.lang.String)" target="_self"&gt;DbxCredential​&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 19:56:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612686#M28329</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-07-28T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK:  authorizing with a refresh token, getting "no auth function available for given</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612700#M28330</link>
      <description>&lt;P&gt;That did the trick.&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 21:11:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-authorizing-with-a-refresh-token-getting-quot-no-auth/m-p/612700#M28330</guid>
      <dc:creator>TC888</dc:creator>
      <dc:date>2022-07-28T21:11:20Z</dc:date>
    </item>
  </channel>
</rss>

