<?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: ESRI JS API: IdentityManager: how to use localStorage in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/1005394#M70933</link>
    <description>&lt;P&gt;Excellent!!!&lt;/P&gt;</description>
    <pubDate>Sun, 29 Nov 2020 17:16:10 GMT</pubDate>
    <dc:creator>Ranga_Tolapi</dc:creator>
    <dc:date>2020-11-29T17:16:10Z</dc:date>
    <item>
      <title>ESRI JS API: IdentityManager: how to use localStorage</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/454916#M42045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've followed few sample on OAuth and IdentityManager and successfully implemented it into our internal portal, but each time a user closes the window, he has to authenticate himself again when accessing the application. After inspecting the browser storage data, I've noticed the OAuth info is stored in he sessionStorage rather than localStorage&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once user is authenticated and redirected from ESRI Login Page, I'm&amp;nbsp;using the following function to finalize the login.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; background-color: #f7faff; font-weight: bold;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;location&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;hash&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;) {
&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;  &lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;opener&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;require&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #f7faff; font-weight: bold;"&gt;'esri/kernel'&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;).&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #7a7a43; background-color: #f7faff;"&gt;setOAuthResponseHash&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;location&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; font-weight: bold;"&gt;hash&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;)
&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;  &lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #7a7a43; background-color: #f7faff;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;()
&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff;"&gt;}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;But how can I tell the IdentityManager to use the localStorage instead of sessionStorage?&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>Sat, 11 Dec 2021 20:17:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/454916#M42045</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T20:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API: IdentityManager: how to use localStorage</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/454917#M42046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ok, so by reverse engineering the js api for IdentityManager, I've added the&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;amp;persist=true&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;to the response hash.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;if &lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;location&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;hash&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;) {
&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;opener&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;require&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #008000; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;'esri/kernel'&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;).&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #7a7a43; background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;setOAuthResponseHash&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;location&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; background-color: #f7faff; border: 0px; font-weight: bold; font-size: 12px;"&gt;hash + '&amp;amp;persist=true'&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;)
&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;window&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #7a7a43; background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;()
&lt;/SPAN&gt;&lt;SPAN style="background-color: #f7faff; border: 0px; font-weight: inherit; font-size: 12px;"&gt;}

&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;And that has forced the IdentityManager to store it in the localStorage rather than the sessionStorage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interesting thing is, that the ESRI's login popup window doesn't have '&lt;STRONG&gt;Remember Me&lt;/STRONG&gt;' checkbox for enterprise logins, but it does for the standard login. I believe this would've solved our issue but at least I have the workaround.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:17:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/454917#M42046</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T20:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API: IdentityManager: how to use localStorage</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/1005394#M70933</link>
      <description>&lt;P&gt;Excellent!!!&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 17:16:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/1005394#M70933</guid>
      <dc:creator>Ranga_Tolapi</dc:creator>
      <dc:date>2020-11-29T17:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: ESRI JS API: IdentityManager: how to use localStorage</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/1204021#M78338</link>
      <description>&lt;P&gt;Where do you put this code at. I want to use it for my node.js app&lt;/P&gt;</description>
      <pubDate>Thu, 18 Aug 2022 00:47:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/esri-js-api-identitymanager-how-to-use/m-p/1204021#M78338</guid>
      <dc:creator>MrGIS</dc:creator>
      <dc:date>2022-08-18T00:47:24Z</dc:date>
    </item>
  </channel>
</rss>

