<?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: OAuth 2.0 JS API 4.4 error in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338252#M31273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Go to your Online page, something &amp;lt;user&amp;gt;.arcgis.com, go to Content, filter by Apps/Registered Apps&lt;/P&gt;&lt;P&gt;Click on your app, go to settings.&lt;/P&gt;&lt;P&gt;Under settings,&amp;nbsp;go to Application Settings area and click on Registered Info button.&lt;/P&gt;&lt;P&gt;Update the URI redirects here, this is what one of mine looks like.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/361765_pastedImage_1.png" style="width: 620px; height: 317px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Jul 2017 16:36:04 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2017-07-11T16:36:04Z</dc:date>
    <item>
      <title>OAuth 2.0 JS API 4.4 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338249#M31270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to implement OAuth login for my web app. I followed the API sample here :&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/index.html"&gt;Access ArcGIS Online items using OAuthentication | ArcGIS API for JavaScript 4.4&lt;/A&gt;&amp;nbsp;. It&amp;nbsp;works for me when I open the live demo, but when I download the file and open it in chrome locally. I got this error:&amp;nbsp;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/361415_pastedImage_2.png" style="width: 620px; height: 85px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How should I fix this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 20:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338249#M31270</guid>
      <dc:creator>Yunpiao_WhitneyBai</dc:creator>
      <dc:date>2017-07-10T20:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth 2.0 JS API 4.4 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338250#M31271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to update it with your own appId and set up the redirect to your dev machine.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/" title="https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/"&gt;Implementing App Login | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 20:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338250#M31271</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2017-07-10T20:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth 2.0 JS API 4.4 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338251#M31272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rene,&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the reply. I tried that already. But the error is the same. I am confused that should I modify&amp;nbsp;the code&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;esriId.getCredential(info.portalUrl + "/sharing")&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;? &amp;nbsp;I replace this code with&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;window.open('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com%2Fsharing%2Frest%2Foauth2%2Fauthorize%3Fclient_id%3D%27%2BclientId%2B%27%26response_type%3Dtoken%26expiration%3D20160%26redirect_uri%3D" rel="nofollow" target="_blank"&gt;https://www.arcgis.com/sharing/rest/oauth2/authorize?client_id='+clientId+'&amp;amp;response_type=token&amp;amp;expiration=20160&amp;amp;redirect_uri=&lt;/A&gt;&lt;SPAN&gt;' + window.encodeURIComponent(redirectUri), 'oauth-window', 'height=400,width=600,menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;And it works. But I do not want hard code this directURL. What should I do?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whitney&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2017 21:11:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338251#M31272</guid>
      <dc:creator>Yunpiao_WhitneyBai</dc:creator>
      <dc:date>2017-07-10T21:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth 2.0 JS API 4.4 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338252#M31273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Go to your Online page, something &amp;lt;user&amp;gt;.arcgis.com, go to Content, filter by Apps/Registered Apps&lt;/P&gt;&lt;P&gt;Click on your app, go to settings.&lt;/P&gt;&lt;P&gt;Under settings,&amp;nbsp;go to Application Settings area and click on Registered Info button.&lt;/P&gt;&lt;P&gt;Update the URI redirects here, this is what one of mine looks like.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/361765_pastedImage_1.png" style="width: 620px; height: 317px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 16:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338252#M31273</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2017-07-11T16:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth 2.0 JS API 4.4 error</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338253#M31274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rene,&lt;/P&gt;&lt;P&gt;Thanks for the instruction. Similarly, I added&amp;nbsp;my portals in the app&amp;nbsp;&lt;IMG __jive_id="361674" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/361674_pastedImage_1.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;esriId.getCredential(info.portalUrl+"/sharing");&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The getCredential function now works and showing the &amp;nbsp;AGOL login form&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="361832" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/361832_pastedImage_3.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;However, after the login, nothing happens.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;esriId.checkSignInStatus(portalUrl+"/sharing").then( function() {&lt;BR /&gt; //displayItems();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;alert("ssss");&lt;BR /&gt; }).otherwise( function() {&lt;BR /&gt; // Anonymous view&lt;BR /&gt; domStyle.set("anonymousPanel", "display", "block");&lt;BR /&gt; domStyle.set("personalizedPanel", "display", "none");&lt;BR /&gt; }&lt;BR /&gt; );&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Neither the resolved or rejected function executes after a successful login.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I change the parameter (&lt;SPAN style="background-color: #f6f6f6;"&gt;portalUrl+"/sharing"&lt;/SPAN&gt;) to somthing else?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, after I login and direct to another html page that also requires some feature access, how can I check it is already login and avoid a second login?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whitney&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 18:07:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth-2-0-js-api-4-4-error/m-p/338253#M31274</guid>
      <dc:creator>Yunpiao_WhitneyBai</dc:creator>
      <dc:date>2017-07-11T18:07:38Z</dc:date>
    </item>
  </channel>
</rss>

