<?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: Auth2 Authentication check in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253554#M14642</link>
    <description>&lt;P&gt;Using the API v2 Java SDK on Android, you can check if the app authorization was approved and get the access token using getOAuth2Token &lt;A href=" https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22" target="_self"&gt;as shown here&lt;/A&gt;. It will return null if not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DropboxClientFactory.init &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/395d463840778b4c6ec730aef82b0a9dbee10f8e/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxClientFactory.java#L15" target="_self"&gt;method just builds a local client object&lt;/A&gt;, using whatever access token you give it, so you don't need to check for success. You can see it used &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/5f47303107da2813f696b520ce976b73d0ba7847/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L39" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to check that your access token is still valid, you need to make any actual API call, such as &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/DbxUserUsersRequests.html#getCurrentAccount--" target="_self"&gt;getCurrentAccount&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Nov 2017 19:09:57 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2017-11-20T19:09:57Z</dc:date>
    <item>
      <title>Auth2 Authentication check</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253372#M14621</link>
      <description>&lt;P&gt;I would like to be able to check if&amp;nbsp;Dropbox authentication was successful.&lt;/P&gt;
&lt;P&gt;In the old API v1, it was possible to run the&amp;nbsp;following code:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;        AndroidAuthSession session = dropboxApi.getSession();&lt;BR /&gt;        if (session.authenticationSuccessful()) {&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;            try {&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                // Mandatory call to complete the auth&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                session.finishAuthentication();&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                storeAuth(session);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;            } catch (IllegalStateException e) {&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                cs = "Could not authenticate with Dropbox:" + e.getLocalizedMessage();&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;                ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;            }&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        }&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;What would be the equivalent method in API v2 when running the following code:&lt;/P&gt;
&lt;PRE&gt;Auth.&lt;SPAN&gt;startOAuth2Authentication&lt;/SPAN&gt;(&lt;SPAN&gt;this&lt;/SPAN&gt;, &lt;SPAN&gt;APP_KEY&lt;/SPAN&gt;);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, is it possible to check if the following call was successful:&lt;/P&gt;
&lt;PRE&gt;DropboxClientFactory.&lt;SPAN&gt;init&lt;/SPAN&gt;(accessToken);&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:17:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253372#M14621</guid>
      <dc:creator>MarioEM</dc:creator>
      <dc:date>2019-05-29T09:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Auth2 Authentication check</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253388#M14622</link>
      <description>*moves to API forum*</description>
      <pubDate>Sun, 19 Nov 2017 13:25:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253388#M14622</guid>
      <dc:creator>Mark</dc:creator>
      <dc:date>2017-11-19T13:25:45Z</dc:date>
    </item>
    <item>
      <title>Re: Auth2 Authentication check</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253554#M14642</link>
      <description>&lt;P&gt;Using the API v2 Java SDK on Android, you can check if the app authorization was approved and get the access token using getOAuth2Token &lt;A href=" https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L22" target="_self"&gt;as shown here&lt;/A&gt;. It will return null if not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DropboxClientFactory.init &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/395d463840778b4c6ec730aef82b0a9dbee10f8e/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxClientFactory.java#L15" target="_self"&gt;method just builds a local client object&lt;/A&gt;, using whatever access token you give it, so you don't need to check for success. You can see it used &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/5f47303107da2813f696b520ce976b73d0ba7847/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L39" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to check that your access token is still valid, you need to make any actual API call, such as &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/users/DbxUserUsersRequests.html#getCurrentAccount--" target="_self"&gt;getCurrentAccount&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 19:09:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253554#M14642</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-11-20T19:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Auth2 Authentication check</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253824#M14660</link>
      <description>&lt;P&gt;Thank you Greg for the clarification. I was already doing that in code, as suggested, but I thought there was possibly another way to immediately check authentication.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 10:33:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Auth2-Authentication-check/m-p/253824#M14660</guid>
      <dc:creator>MarioEM</dc:creator>
      <dc:date>2017-11-22T10:33:17Z</dc:date>
    </item>
  </channel>
</rss>

