<?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: Error 400 (invalid redirect URI) when using OAuth 2.0  in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-400-invalid-redirect-uri-when-using-oauth-2/m-p/337824#M31240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jesse, have you added your redirect uri to the list of allowed uri's at the bottom of the Authentication tab on the page where your app is registered?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/346131_pastedImage_1.png" style="width: 620px; height: 161px;" /&gt;&lt;/P&gt;&lt;P&gt;The uri here has to match the redirect uri in your code. I received an error, that seems to be the same as yours, and it was because I had not added the uri to the list or I had a disagreement between my redirect uri var in my code and the allowed uri's in my list on the app registration page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Apr 2017 18:00:09 GMT</pubDate>
    <dc:creator>TCEQGIS_Team</dc:creator>
    <dc:date>2017-04-11T18:00:09Z</dc:date>
    <item>
      <title>Error 400 (invalid redirect URI) when using OAuth 2.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-400-invalid-redirect-uri-when-using-oauth-2/m-p/337823#M31239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've registered a web app in my AGOL org account. It's not a geospatial app, but will be pulling secure data from REST services in AGOL that are&amp;nbsp;only shared with specific individuals . When I registered it, it generated an App ID and I followed the OAuth2.0 examples to try and have the app login on behalf of itself. However, I continue to receive an error: 400 (invalid redirect uri) whenever I try and launch the esriId.getCredential() method using Identity Manager.&lt;/P&gt;&lt;P&gt;______________________________________&lt;/P&gt;&lt;P&gt;Snippet here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN&gt;var portalUrl = "&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" rel="nofollow" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var info = new OAuthInfo({&lt;BR /&gt; appId: "&amp;lt;removed app id for this question post&amp;gt;",&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;popup: true&lt;BR /&gt; });&lt;BR /&gt; esriId.registerOAuthInfos([info]);&lt;/P&gt;&lt;P&gt;esriId.checkSignInStatus(info.portalUrl + "/sharing").then(&lt;BR /&gt; function (){&lt;BR /&gt; // User has signed in&lt;BR /&gt; displayItems();&lt;BR /&gt; }&lt;BR /&gt; ).otherwise(&lt;BR /&gt; function (){&lt;BR /&gt; // User has not signed in&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;P&gt;on(dom.byId("sign-in"), "click", function (){&lt;BR /&gt; // user will be shown the OAuth Sign In page&lt;BR /&gt; esriId.getCredential(info.portalUrl + "/sharing", {&lt;BR /&gt; oAuthPopupConfirmation: true&lt;BR /&gt; }&lt;BR /&gt; ).then(function (){&lt;BR /&gt; displayItems();&lt;BR /&gt; });&lt;BR /&gt; });&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;_____________________________&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the esri documentation when it says when registering the app, that a Redirect URI are&amp;nbsp;"&lt;SPAN style="color: #4c4c4c;"&gt;valid addresses that users of your app can be redirected to after they successfully log in."&lt;/SPAN&gt;&amp;nbsp;Am I not this understanding correctly, but shouldn't this mean that the Redirect URI should be the same as the address of the application? If my application is located at &lt;A class="unlinked"&gt;https://this.com, upon a user signing-in&lt;/A&gt;&amp;nbsp;wouldn't I want the user to return to just return&amp;nbsp;&lt;A class="unlinked"&gt;https://this.com&lt;/A&gt;&amp;nbsp;after they've signed in?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2016 20:27:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-400-invalid-redirect-uri-when-using-oauth-2/m-p/337823#M31239</guid>
      <dc:creator>JesseOsborne1</dc:creator>
      <dc:date>2016-12-30T20:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error 400 (invalid redirect URI) when using OAuth 2.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-400-invalid-redirect-uri-when-using-oauth-2/m-p/337824#M31240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jesse, have you added your redirect uri to the list of allowed uri's at the bottom of the Authentication tab on the page where your app is registered?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/346131_pastedImage_1.png" style="width: 620px; height: 161px;" /&gt;&lt;/P&gt;&lt;P&gt;The uri here has to match the redirect uri in your code. I received an error, that seems to be the same as yours, and it was because I had not added the uri to the list or I had a disagreement between my redirect uri var in my code and the allowed uri's in my list on the app registration page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Apr 2017 18:00:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/error-400-invalid-redirect-uri-when-using-oauth-2/m-p/337824#M31240</guid>
      <dc:creator>TCEQGIS_Team</dc:creator>
      <dc:date>2017-04-11T18:00:09Z</dc:date>
    </item>
  </channel>
</rss>

