<?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: Oauth2.0 authentication not showing login page in ArcGIS Maps SDK for Unity Questions</title>
    <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233389#M315</link>
    <description>&lt;P&gt;I also just realized that your redirect URL probably doesn't make sense. On windows the localhost is typically used for the redicect since the local user needs to authenticate. It doesn't make sense to ask a remote server open the auth workflow.&lt;/P&gt;</description>
    <pubDate>Fri, 18 Nov 2022 20:30:16 GMT</pubDate>
    <dc:creator>Matt_Nelson</dc:creator>
    <dc:date>2022-11-18T20:30:16Z</dc:date>
    <item>
      <title>Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1231625#M301</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;I tried following the steps here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/unity/authentication/" target="_blank"&gt;https://developers.arcgis.com/unity/authentication/&lt;/A&gt;&amp;nbsp;(Components&amp;nbsp;&lt;SPAN&gt;and C# API&lt;/SPAN&gt;) but didn't manage to show the login page on Windows and Android.&lt;/P&gt;&lt;P&gt;Anyone managed to make it work?&lt;/P&gt;&lt;P&gt;These are my steps:&lt;BR /&gt;1. Made an empty scene.&lt;BR /&gt;2. Added OAuthScene script to an empty gameObject and added the client ID, Redirect URI mobile(unitydl://mylink?scene1), desktop(random website) and service URL which is a link to a 3D layer.&lt;BR /&gt;3. Added also&amp;nbsp;OAuthChallengeHandlersInitializer script to the same gameObject.&lt;/P&gt;&lt;P&gt;Also tried to add the same components to an ArcGIS Map gameObject but the login page never shows.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 10:00:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1231625#M301</guid>
      <dc:creator>MazenTalaat</dc:creator>
      <dc:date>2022-11-15T10:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1232243#M307</link>
      <description>&lt;P&gt;Open one of our component examples and don't add the OauthScene script (that is for api worfklows)&lt;BR /&gt;&lt;BR /&gt;At the bottom of the ArcGIS Map Component setup the oauth configuration entirely thru the inspector and let me know if you get it to work.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 16:12:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1232243#M307</guid>
      <dc:creator>Matt_Nelson</dc:creator>
      <dc:date>2022-11-16T16:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1232706#M312</link>
      <description>&lt;P&gt;I opened the ComponentGlobalSample scene and configured the &lt;SPAN&gt;OAuth&amp;nbsp;then added&amp;nbsp;&lt;/SPAN&gt;a private layer and chose the auth. for all layers:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="1.png" style="width: 442px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/56208i8C88318A381877CB/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.png" alt="1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now it gives me an error related to the URI:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="2.PNG" style="width: 554px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/56207iC83C98B02F869D46/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.PNG" alt="2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and here are my app. settings in the dev. dashboard:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="3.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/56209i3A27260B8E710ECD/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.png" alt="3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Nov 2022 14:48:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1232706#M312</guid>
      <dc:creator>MazenTalaat</dc:creator>
      <dc:date>2022-11-17T14:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233388#M314</link>
      <description>&lt;P&gt;Ok we shouldn't be erroring like that for the api key in this case but if you add an api key does it work?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 20:28:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233388#M314</guid>
      <dc:creator>Matt_Nelson</dc:creator>
      <dc:date>2022-11-18T20:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233389#M315</link>
      <description>&lt;P&gt;I also just realized that your redirect URL probably doesn't make sense. On windows the localhost is typically used for the redicect since the local user needs to authenticate. It doesn't make sense to ask a remote server open the auth workflow.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 20:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233389#M315</guid>
      <dc:creator>Matt_Nelson</dc:creator>
      <dc:date>2022-11-18T20:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233430#M316</link>
      <description>&lt;P&gt;Adding an API key will always load the layers and ignore the auth.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 21:54:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233430#M316</guid>
      <dc:creator>MazenTalaat</dc:creator>
      <dc:date>2022-11-18T21:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233440#M317</link>
      <description>&lt;P&gt;You are correct! I added&amp;nbsp;&lt;A href="http://localhost:1234/auth" target="_blank"&gt;http://localhost:1234/auth&lt;/A&gt;&amp;nbsp;as you mentioned here:&amp;nbsp;&lt;A href="https://earlyadopter.esri.com/project/forum/thread.html?cap=0d5c8b23b5014f1da5e164c1e9d921f0&amp;amp;forid={D3F0EB55-5754-4E02-9849-559D82A80FCB}&amp;amp;topid={4FCE321C-5615-4626-AA89-B172B62EAE18}" target="_self"&gt;Automatic authentication in the background&lt;/A&gt;&amp;nbsp;and now I can see the auth. page in the browser.&lt;/P&gt;&lt;P&gt;What about android? I tried using unity's deep link: unitydl://mylink?scene1 but it keeps saying URI is invalid.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2022 22:08:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233440#M317</guid>
      <dc:creator>MazenTalaat</dc:creator>
      <dc:date>2022-11-18T22:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: Oauth2.0 authentication not showing login page</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233589#M318</link>
      <description>&lt;P&gt;Good news,&lt;/P&gt;&lt;P data-unlink="true"&gt;I tried to use the Authorization endpoints (https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=&amp;lt;APP_CLIENT_ID&amp;gt;&amp;amp;response_type=code&amp;amp;expiration=&amp;lt;N_SECONDS&amp;gt;&amp;amp;redirect_uri=&amp;lt;REDIRECT_URI&amp;gt;)&lt;/P&gt;&lt;P&gt;and it worked with all redirect links(HTTPS and unity deeplinks)! I think it's a bug in the SDK when reading the URI.&lt;/P&gt;&lt;P&gt;So here are the steps if anyone has the same issue:&lt;/P&gt;&lt;P data-unlink="true"&gt;1. Setup your application info. here:&amp;nbsp;&lt;A href="https://developers.arcgis.com/applications" target="_self"&gt;Applications Auth.&lt;/A&gt;&amp;nbsp;and add unity's deep link for android example:&amp;nbsp;unitydl://mylink?scene1&lt;BR /&gt;2. Enable deep link in unity (&lt;A href="https://docs.unity3d.com/2020.3/Documentation/Manual/enabling-deep-linking.html" target="_self"&gt;Enabling deep linking&lt;/A&gt;).&lt;BR /&gt;2.&amp;nbsp;Open the URL using a script ("https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id=&amp;nbsp;&amp;lt;APP_CLIENT_ID&amp;gt;&amp;amp;response_type=code&amp;amp;expiration=&amp;lt;N_SECONDS&amp;gt;&amp;amp;redirect_uri=&amp;lt;REDIRECT_URI&amp;gt;") (don't forget to add your info. and remove the &amp;lt; &amp;gt;, more info. here: &lt;A href="https://developers.arcgis.com/documentation/mapping-apis-and-services/security/arcgis-identity/serverless-native-apps/" target="_self"&gt;Mobile Endpoints&lt;/A&gt;&amp;nbsp;).&lt;BR /&gt;3. If everything is correct, your default browser will open asking you to log in.&lt;BR /&gt;4. After logging in the REDIRECT_URI which is a deep link will make you return to the app.&lt;BR /&gt;5. You can split the deep link and extract the auth. code which will be used to get the access token.&lt;BR /&gt;6. Use unity's web request with this URL to get the access token ("https://www.arcgis.com/sharing/rest/oauth2/token?client_id=&amp;lt;CLIENT_ID&amp;gt;&amp;amp;redirect_uri=&amp;lt;REDIRECT_URI&amp;gt;&amp;amp;grant_type=authorization_code&amp;amp;code=&amp;lt;CODE&amp;gt;")&lt;BR /&gt;7. The response will look like this:&amp;nbsp;&lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;SPAN&gt;"access_token":"{token}", &lt;/SPAN&gt;&lt;SPAN&gt;"expires_in":1800, &lt;/SPAN&gt;&lt;SPAN&gt;"username":"{user-name}", &lt;/SPAN&gt;&lt;SPAN&gt;"refresh_token":"{refresh-token}" &lt;/SPAN&gt;&lt;SPAN&gt;}.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 22:17:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/oauth2-0-authentication-not-showing-login-page/m-p/1233589#M318</guid>
      <dc:creator>MazenTalaat</dc:creator>
      <dc:date>2022-11-21T22:17:05Z</dc:date>
    </item>
  </channel>
</rss>

