<?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: signout or Logout in Android App using OAuth in Kotlin Maps SDK Questions</title>
    <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1301370#M82</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46685"&gt;@GuntherHeppner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the response. I have tried the signout flow, but even though it revokes the token and we clear credentials from credentialstore, argGIS is able to get the user info cached up.&lt;BR /&gt;&lt;BR /&gt;Kindly refer the below code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ArcGISAuthenticationChallengeHandler &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;challenge &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;oAuthConfiguration&lt;/SPAN&gt;.canBeUsedForUrl(challenge.&lt;SPAN&gt;requestUrl&lt;/SPAN&gt;)) {&lt;BR /&gt;        &lt;SPAN&gt;val &lt;/SPAN&gt;oAuthUserCredential =&lt;BR /&gt;            OAuthUserCredential.create(&lt;SPAN&gt;oAuthConfiguration&lt;/SPAN&gt;) &lt;SPAN&gt;{ &lt;/SPAN&gt;oAuthUserSignIn &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;                oAuthUserSignInViewModel.promptForOAuthUserSignIn(oAuthUserSignIn)&lt;BR /&gt;            &lt;SPAN&gt;}&lt;/SPAN&gt;.&lt;SPAN&gt;getOrThrow&lt;/SPAN&gt;()&lt;BR /&gt;&lt;BR /&gt;        ArcGISAuthenticationChallengeResponse.ContinueWithCredential(oAuthUserCredential)&lt;BR /&gt;    } &lt;SPAN&gt;else &lt;/SPAN&gt;{&lt;BR /&gt;        ArcGISAuthenticationChallengeResponse.ContinueAndFailWithError(&lt;BR /&gt;            UnsupportedOperationException()&lt;BR /&gt;        )&lt;BR /&gt;    }&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;oAuthUserCredential is always gets back the Oauth user info even after I signout.&lt;BR /&gt;&lt;BR /&gt;I have also tried revoking token using API before I got your reply. it returns success. But It seems never cleanup.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/revoke-token.htm" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/revoke-token.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Is there something I miss ?. I referred the sample example authenticate-with-oauth for my Implementation. I used the customChromeTabs as suggested in sample.&lt;BR /&gt;&lt;BR /&gt;It would be great if you can help me with.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2023 01:33:41 GMT</pubDate>
    <dc:creator>DeepamPalaniswami</dc:creator>
    <dc:date>2023-06-21T01:33:41Z</dc:date>
    <item>
      <title>signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1300587#M78</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;Need some help reg the Signout flow in ArcGIS SDK for kotlin. I have successfully logined using OAuth, but I am unable to find some API or docs in reference to how to sign out. In Swift code base example, I can see&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;ArcGISEnvironment.authenticationManager.revokeOAuthTokens() await ArcGISEnvironment.authenticationManager.clearCredentialStores()&lt;BR /&gt;&lt;BR /&gt;Link:&amp;nbsp;&lt;A href="https://developers.arcgis.com/swift/sample-code/authenticate-with-oauth/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/swift/sample-code/authenticate-with-oauth/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;But unable to see similar thing in Android. Need your help on how to achieve the logout flow. Android Authentication manager doesn't have similar functions exposed.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jun 2023 02:11:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1300587#M78</guid>
      <dc:creator>DeepamPalaniswami</dc:creator>
      <dc:date>2023-06-19T02:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1300884#M79</link>
      <description>&lt;P&gt;Team, Is there any API where I can invalidate the Oauth token?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 00:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1300884#M79</guid>
      <dc:creator>DeepamPalaniswami</dc:creator>
      <dc:date>2023-06-20T00:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1300988#M81</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/694452"&gt;@DeepamPalaniswami&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The Kotlin API currently does not expose convenience methods on AuthenticationManager to revoke OAuth tokens and to clear the credential stores. Instead you can do the following:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;suspend fun &lt;/SPAN&gt;&lt;SPAN&gt;signOut&lt;/SPAN&gt;() {&lt;BR /&gt;  &lt;SPAN&gt;// revoke any OAuth tokens&lt;BR /&gt;&lt;/SPAN&gt;  ArcGISEnvironment.&lt;SPAN&gt;authenticationManager&lt;/SPAN&gt;.&lt;SPAN&gt;arcGISCredentialStore&lt;/SPAN&gt;.getCredentials().&lt;SPAN&gt;forEach &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;it &lt;/SPAN&gt;&lt;SPAN&gt;is &lt;/SPAN&gt;OAuthUserCredential) {&lt;BR /&gt;      &lt;SPAN&gt;lifecycleScope&lt;/SPAN&gt;.&lt;SPAN&gt;async &lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;        it&lt;/SPAN&gt;.revokeToken()&lt;BR /&gt;      &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;  &lt;SPAN&gt;}&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;  &lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;// clear credential stores&lt;BR /&gt;&lt;/SPAN&gt;  ArcGISEnvironment.&lt;SPAN&gt;authenticationManager&lt;/SPAN&gt;.&lt;SPAN&gt;arcGISCredentialStore&lt;/SPAN&gt;.removeAll()&lt;BR /&gt;  ArcGISEnvironment.&lt;SPAN&gt;authenticationManager&lt;/SPAN&gt;.&lt;SPAN&gt;networkCredentialStore&lt;/SPAN&gt;.removeAll()&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 09:48:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1300988#M81</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2023-06-20T09:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1301370#M82</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/46685"&gt;@GuntherHeppner&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for the response. I have tried the signout flow, but even though it revokes the token and we clear credentials from credentialstore, argGIS is able to get the user info cached up.&lt;BR /&gt;&lt;BR /&gt;Kindly refer the below code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;ArcGISAuthenticationChallengeHandler &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;/SPAN&gt;challenge &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;if &lt;/SPAN&gt;(&lt;SPAN&gt;oAuthConfiguration&lt;/SPAN&gt;.canBeUsedForUrl(challenge.&lt;SPAN&gt;requestUrl&lt;/SPAN&gt;)) {&lt;BR /&gt;        &lt;SPAN&gt;val &lt;/SPAN&gt;oAuthUserCredential =&lt;BR /&gt;            OAuthUserCredential.create(&lt;SPAN&gt;oAuthConfiguration&lt;/SPAN&gt;) &lt;SPAN&gt;{ &lt;/SPAN&gt;oAuthUserSignIn &lt;SPAN&gt;-&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;                oAuthUserSignInViewModel.promptForOAuthUserSignIn(oAuthUserSignIn)&lt;BR /&gt;            &lt;SPAN&gt;}&lt;/SPAN&gt;.&lt;SPAN&gt;getOrThrow&lt;/SPAN&gt;()&lt;BR /&gt;&lt;BR /&gt;        ArcGISAuthenticationChallengeResponse.ContinueWithCredential(oAuthUserCredential)&lt;BR /&gt;    } &lt;SPAN&gt;else &lt;/SPAN&gt;{&lt;BR /&gt;        ArcGISAuthenticationChallengeResponse.ContinueAndFailWithError(&lt;BR /&gt;            UnsupportedOperationException()&lt;BR /&gt;        )&lt;BR /&gt;    }&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;oAuthUserCredential is always gets back the Oauth user info even after I signout.&lt;BR /&gt;&lt;BR /&gt;I have also tried revoking token using API before I got your reply. it returns success. But It seems never cleanup.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/revoke-token.htm" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/revoke-token.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Is there something I miss ?. I referred the sample example authenticate-with-oauth for my Implementation. I used the customChromeTabs as suggested in sample.&lt;BR /&gt;&lt;BR /&gt;It would be great if you can help me with.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 01:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1301370#M82</guid>
      <dc:creator>DeepamPalaniswami</dc:creator>
      <dc:date>2023-06-21T01:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1301938#M83</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/694452"&gt;@DeepamPalaniswami&lt;/a&gt;&amp;nbsp;- judging from your attached video, you are signing in via OAuth with an enterprise login. The login browser window (Custom Chrome Tab) will cache the sign in data, but the Maps SDK does not have any control over that, thus cannot clear the cached browser data on sign out. You would need to do this explicitly as you sign out. Please try the &lt;A href="https://developer.android.com/reference/android/webkit/CookieManager#removeAllCookie()" target="_self"&gt;Android webkit CookieManager API&lt;/A&gt; as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;CookieManager.getInstance().removeAllCookies(null)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Jun 2023 12:28:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1301938#M83</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2023-06-22T12:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1305474#M84</link>
      <description>&lt;P&gt;Possibly i need to try with Webiview instead of custom tabs as we cannot clear the cache in custom tabs. I willl keep you posted with my changes. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 02:11:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1305474#M84</guid>
      <dc:creator>DeepamPalaniswami</dc:creator>
      <dc:date>2023-07-04T02:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: signout or Logout in Android App using OAuth</title>
      <link>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1305668#M87</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/694452"&gt;@DeepamPalaniswami&lt;/a&gt;&amp;nbsp;. Please keep us posted. We are investigating this issue on our side as well.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 08:36:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/kotlin-maps-sdk-questions/signout-or-logout-in-android-app-using-oauth/m-p/1305668#M87</guid>
      <dc:creator>GuntherHeppner</dc:creator>
      <dc:date>2023-07-05T08:36:13Z</dc:date>
    </item>
  </channel>
</rss>

