<?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 OAuth2.0 redirect question in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth2-0-redirect-question/m-p/368435#M34174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing a POC of the React application that is supposed to retrieve the user credentials from the arcgis.com and/or our internal portal. I've setup the router with some protected router, but I think I need an advice on what is the best approach to achieve the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) app has 3 routes, /home - public route, /protected - protected route, /signin - public route with the signin components.&lt;/P&gt;&lt;P&gt;2) if user clicks the /protected route, I want to redirect to /signing (done)&lt;/P&gt;&lt;P&gt;3)&amp;nbsp;on the /signin page, if user clicks 'Sign In' and signs in using the oauth provider and is successfully authenticated, then &lt;STRONG&gt;redirect him to /protected&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;4) if user is not authenticated and clicks the /signin page, and the is successfully authenticated, then &lt;STRONG&gt;redirect him to /home&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current solution is that I've setup the redirect on the application settings in the portal (&lt;A href="http://localhost:3000"&gt;http://localhost:3000&lt;/A&gt;), and before the authentication, I store the last path (referrer path) into localStorage and then pull it up. But I'd rather not do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is this normally achieved? Can I provide the OAuthInfo some extra request params that it would parse back so I can use it in my application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, another question is,&amp;nbsp;how can I skip the step of&amp;nbsp;displaying&amp;nbsp;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;esriOAuthSignInDialog (after setting the popup to true in the OAuthInfo) and having to click 'ok' in order to proceed to OAuth signing new window popup??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Feb 2019 09:58:29 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2019-02-22T09:58:29Z</dc:date>
    <item>
      <title>OAuth2.0 redirect question</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth2-0-redirect-question/m-p/368435#M34174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm doing a POC of the React application that is supposed to retrieve the user credentials from the arcgis.com and/or our internal portal. I've setup the router with some protected router, but I think I need an advice on what is the best approach to achieve the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) app has 3 routes, /home - public route, /protected - protected route, /signin - public route with the signin components.&lt;/P&gt;&lt;P&gt;2) if user clicks the /protected route, I want to redirect to /signing (done)&lt;/P&gt;&lt;P&gt;3)&amp;nbsp;on the /signin page, if user clicks 'Sign In' and signs in using the oauth provider and is successfully authenticated, then &lt;STRONG&gt;redirect him to /protected&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;4) if user is not authenticated and clicks the /signin page, and the is successfully authenticated, then &lt;STRONG&gt;redirect him to /home&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My current solution is that I've setup the redirect on the application settings in the portal (&lt;A href="http://localhost:3000"&gt;http://localhost:3000&lt;/A&gt;), and before the authentication, I store the last path (referrer path) into localStorage and then pull it up. But I'd rather not do that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How is this normally achieved? Can I provide the OAuthInfo some extra request params that it would parse back so I can use it in my application?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, another question is,&amp;nbsp;how can I skip the step of&amp;nbsp;displaying&amp;nbsp;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;esriOAuthSignInDialog (after setting the popup to true in the OAuthInfo) and having to click 'ok' in order to proceed to OAuth signing new window popup??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Feb 2019 09:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/oauth2-0-redirect-question/m-p/368435#M34174</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-02-22T09:58:29Z</dc:date>
    </item>
  </channel>
</rss>

