<?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: Invalid Redirect URI for Server Based Authentication when deploying to cloudfront (localhost works fine). in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/invalid-redirect-uri-for-server-based/m-p/1152801#M44825</link>
    <description>&lt;P&gt;Was this problem resolved? If so can you share the resolution please?&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2022 01:18:54 GMT</pubDate>
    <dc:creator>SusanPollard</dc:creator>
    <dc:date>2022-03-11T01:18:54Z</dc:date>
    <item>
      <title>Invalid Redirect URI for Server Based Authentication when deploying to cloudfront (localhost works fine).</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/invalid-redirect-uri-for-server-based/m-p/221107#M10923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We've been working on a custom feature editor that uses&amp;nbsp;&lt;A href="https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/server-based-user-logins/"&gt;server based user logins&lt;/A&gt;&amp;nbsp;to integrate AWS services with AGOL login. This has been working&amp;nbsp;fine on localhost, the user is sent to the right URL and we can get a token back. Flow is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Send user to URL (below)&lt;/P&gt;&lt;P&gt;2. Get code back&lt;/P&gt;&lt;P&gt;3. Exchange for a token via a lambda, that also registers a Cognito identity token for AWS credentials&lt;/P&gt;&lt;P&gt;4. Send back to client and register with IdentityManager.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Launching it to AWS cloudfront, however, I get an "invalid redirect_uri" error - example:&amp;nbsp;&lt;A href="https://cityofmelbourne.maps.arcgis.com/sharing/rest/oauth2/authorize?client_id=0KBzlPo2662D42j5&amp;amp;expiration=20160&amp;amp;redirect_uri=https%3A%2F%2Fd2b025iknw7h16.cloudfront.net%23&amp;amp;response_type=code"&gt;https://cityofmelbourne.maps.arcgis.com/sharing/rest/oauth2/authorize?client_id=0KBzlPo2662D42j5&amp;amp;expiration=20160&amp;amp;redirect_uri=https%3A%2F%2Fd2b025iknw7h16.cloudfront.net%23&amp;amp;response_type=code&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've added the cloudfront URL to the whitelisted redirect URIs (both https and http). Neither work:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="504928" alt="" class="jive-emoji image-1 jive-image j-img-original" src="/legacyfs/online/504928_Screen Shot 2020-08-31 at 12.05.05 pm.png" /&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a side note, passing an expiration to the above URL (/rest/oauth2/authorize) does nothing, and my token expires within 30 minutes. Am I doing something wrong there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:34:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/invalid-redirect-uri-for-server-based/m-p/221107#M10923</guid>
      <dc:creator>CoMAGOL_ADMINISTRATOR</dc:creator>
      <dc:date>2020-08-31T02:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Redirect URI for Server Based Authentication when deploying to cloudfront (localhost works fine).</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/invalid-redirect-uri-for-server-based/m-p/1152801#M44825</link>
      <description>&lt;P&gt;Was this problem resolved? If so can you share the resolution please?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 01:18:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/invalid-redirect-uri-for-server-based/m-p/1152801#M44825</guid>
      <dc:creator>SusanPollard</dc:creator>
      <dc:date>2022-03-11T01:18:54Z</dc:date>
    </item>
  </channel>
</rss>

