<?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: How to capture OAuth Esri code after 100.11 deprecations? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115724#M7211</link>
    <description>&lt;P&gt;I should also mention that after I upgraded the Runtime SDK, a prompt now shows before the ArcGIS login screen appears. It warns that my app wants to use "arcgis.com" to sign in and I have to press Continue to get the the ArcGIS login.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Nov 2021 17:17:14 GMT</pubDate>
    <dc:creator>greg_eam</dc:creator>
    <dc:date>2021-11-10T17:17:14Z</dc:date>
    <item>
      <title>How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115455#M7208</link>
      <description>&lt;P&gt;I recently upgraded to the ArcGIS Runtime SDK for iOS version 100.12 from 100.9 and now my OAuth single-sign-on does not work. The OAuth sign-on view does display, but once I enter my credentials and click Sign In, I am no longer able to capture the Esri login code that I need.&lt;/P&gt;&lt;P&gt;I understand that these methods were deprecated in 100.11:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;AGSApplicationDelegate.shared().application(_:open:options:)&lt;/LI&gt;&lt;LI&gt;AGSAuthenticationManagerDelegate wantsToShowViewController(_:viewController:)&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;AGSAuthenticationManagerDelegate wantsToDismissViewController(_:viewController:)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However, in my AppDelegate, application(_:openUrl:Options:) no is no longer called after after sign-in is completed.&lt;/P&gt;&lt;P&gt;From what I've seen so far, it sounds like I shouldn't need to make any code changes for this to work. I feel like I am missing something. Any help would be appreciated!&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 22:25:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115455#M7208</guid>
      <dc:creator>greg_eam</dc:creator>
      <dc:date>2021-11-09T22:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115666#M7209</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know and understand few things to help you with this issue.&lt;/P&gt;&lt;P&gt;1. What do you mean by my OAuth single-sign-on does not work?&lt;/P&gt;&lt;P&gt;2. What extra code you had in the&amp;nbsp;&lt;SPAN&gt;AppDelegate's, application(_:openUrl:Options:)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. What you were doing with the Esri login code from the delegate method?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 15:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115666#M7209</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2021-11-10T15:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115710#M7210</link>
      <description>&lt;P&gt;Hi Nimesh,&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;By OAuth single-sign-on not working, I mean that my app's redirect URL is not getting called after Sign In is clicked on the ArcGIS login screen. This had been taking place through the AppDelegate's application(_:openURL:options) method.&lt;/LI&gt;&lt;LI&gt;In this AppDelegate method, I have code that parses out the Esri login code from the provided URL.&lt;/LI&gt;&lt;LI&gt;Once I have the Esri login code, I then pass it to my organization's portal which validates it and returns a login token for my app.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 16:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115710#M7210</guid>
      <dc:creator>greg_eam</dc:creator>
      <dc:date>2021-11-10T16:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115724#M7211</link>
      <description>&lt;P&gt;I should also mention that after I upgraded the Runtime SDK, a prompt now shows before the ArcGIS login screen appears. It warns that my app wants to use "arcgis.com" to sign in and I have to press Continue to get the the ArcGIS login.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 17:17:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115724#M7211</guid>
      <dc:creator>greg_eam</dc:creator>
      <dc:date>2021-11-10T17:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115740#M7212</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Just to let you know why we deprecated those delegate methods. We were using&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller" target="_self"&gt;SFSafariViewController&lt;/A&gt;&amp;nbsp;to display the OAuth login page which is changed to use&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession" target="_self"&gt;ASWebAuthenticationSession&lt;/A&gt;&amp;nbsp;which does not require the&amp;nbsp;&lt;SPAN&gt;AppDelegate's, application(_:openUrl:Options:) to be called. Still you have&amp;nbsp;to setup your App to use the redirectURL as&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession" target="_self"&gt;ASWebAuthenticationSession&lt;/A&gt;&amp;nbsp;is going to use it. Also, the additional prompt you are getting is from&amp;nbsp;&lt;A href="https://developer.apple.com/documentation/authenticationservices/aswebauthenticationsession" target="_self"&gt;ASWebAuthenticationSession&lt;/A&gt;&amp;nbsp;as well.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. You don't need to generate a token using the Esri login code as we do it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Once, AGSPortal object is loaded, you will see the&amp;nbsp;generated access token using the&amp;nbsp;Esri login code on the AGSPortal.credential.token.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nimesh&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 17:46:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115740#M7212</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2021-11-10T17:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115767#M7213</link>
      <description>&lt;P&gt;Nimesh,&lt;/P&gt;&lt;P&gt;Thank you for this information. I did try using the AGSPortal.credential.token value to do my login and it failed. I found the following error on my app's server: "{ code: 400, message: Invalid code }".&lt;/P&gt;&lt;P&gt;I should clarify that I am not using the Esri login code to generate a token from Esri; I am using the Esri login code to generate a token for my own product's login. On my app's server, the Esri code I pass from iOS is validated here with a grant type of authorization code: &lt;A href="https://www.arcgis.com/sharing/rest/oauth2" target="_blank" rel="noopener"&gt;https://www.arcgis.com/sharing/rest/oauth2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Once validated, my app's server provides its own token back to iOS so that I may login to my app. All of this is done after the ArcGIS login succeeds.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 22:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1115767#M7213</guid>
      <dc:creator>greg_eam</dc:creator>
      <dc:date>2021-11-10T22:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to capture OAuth Esri code after 100.11 deprecations?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1123544#M7241</link>
      <description>&lt;P&gt;After much more research, I have found the solution to this. It turns out that I needed to use the 2nd method for implementing OAuth (register a custom URI handler) defined here. I was previously using the 1st method: &lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/security/arcgis-identity/serverless-native-apps/" target="_blank"&gt;https://developers.arcgis.com/documentation/mapping-apis-and-services/security/arcgis-identity/serverless-native-apps/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Implement AGSAuthenticationManagerDelegate (&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_authentication_manager.html#a96f0b45d293fdd1ac19030ef8bcf54bf" target="_blank"&gt;https://developers.arcgis.com/ios/api-reference/interface_a_g_s_authentication_manager.html#a96f0b45d293fdd1ac19030ef8bcf54bf&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Set the AGSAuthenticationManager.shared().delegate to the delegate implementation&lt;/LI&gt;&lt;LI&gt;Call the Esri OAuth2 authorize endpoint (sharing/rest/oauth2/authorize) using ASWebAuthenticationSession&lt;/LI&gt;&lt;LI&gt;In the callback, parse the Esri code out of the result URL&lt;/LI&gt;&lt;LI&gt;Call the Esri OAuth2 token endpoint (sharing/rest/oauth2/token) using AGSRequestOperation&lt;/LI&gt;&lt;LI&gt;In the callback, parse the Esri token from the response&lt;/LI&gt;&lt;LI&gt;Initialize an AGSPortal and call load on it&lt;/LI&gt;&lt;LI&gt;In AGSAuthenticationManagerDelegate.didReceiveAuthenticationChallenge, initialize an AGSCredential with the Esri token (&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_credential.html#af11a55ef3f3ae29670a239e80a08fc83" target="_blank"&gt;https://developers.arcgis.com/ios/api-reference/interface_a_g_s_credential.html#af11a55ef3f3ae29670a239e80a08fc83&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Call continueWithCredential on the challenge object (&lt;A href="https://developers.arcgis.com/ios/api-reference/interface_a_g_s_authentication_challenge.html#a4cac4e6c4a9e3c7c7480e60b36f26f16" target="_blank"&gt;https://developers.arcgis.com/ios/api-reference/interface_a_g_s_authentication_challenge.html#a4cac4e6c4a9e3c7c7480e60b36f26f16&lt;/A&gt;)&lt;/LI&gt;&lt;LI&gt;Call the custom server application with the Esri code to log into custom product&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 07 Dec 2021 20:22:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-capture-oauth-esri-code-after-100-11/m-p/1123544#M7241</guid>
      <dc:creator>greg_eam</dc:creator>
      <dc:date>2021-12-07T20:22:19Z</dc:date>
    </item>
  </channel>
</rss>

