<?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: [RESOLVED] How to destroy a single credential from many? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resolved-how-to-destroy-a-single-credential-from/m-p/299828#M27505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems like I've had a bug there (deeper in the code), but I'll keep testing and see if this works ok.&lt;BR /&gt;&lt;BR /&gt;I do, however, have another thing to note. I initialize IdentityManager from JSON I've serialized before user closes the application. but with each new login, the &lt;STRONG&gt;credentials array keeps growing&lt;/STRONG&gt; even for the &lt;STRONG&gt;same portal and user id&lt;/STRONG&gt;. I'd have expected it to be cleaned up. But seems like I'll have to handle this myself&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 16 Feb 2020 22:06:23 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-02-16T22:06:23Z</dc:date>
    <item>
      <title>[RESOLVED] How to destroy a single credential from many?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resolved-how-to-destroy-a-single-credential-from/m-p/299827#M27504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a web application that requires user to switch between different portals (AGOL + 2x on-prem PORTALS). Each time the requested resource requires a portal access, I'm switching using the&amp;nbsp;&lt;STRONG&gt;immediate&lt;/STRONG&gt; authentication option. This all works ok. If not logged in I use OAuth2.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I wanted to add the option of sign-out of the portal, so I'm receiving the credential from identity manager and destroy it. However, I've noticed that that credentials &lt;STRONG&gt;still exist&lt;/STRONG&gt; within the &lt;STRONG&gt;IdentityManager.credentials&amp;nbsp;&lt;/STRONG&gt;and also in the local storage under&amp;nbsp;&lt;STRONG&gt;esriJSAPIOAuth&lt;/STRONG&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I use IdentityManager.&lt;STRONG&gt;destroyCredentials&lt;/STRONG&gt;() it works, but that's not what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;const &lt;/SPAN&gt;&lt;SPAN style="color: #458383;"&gt;credential &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;this&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;identityManager&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;findCredential&lt;/SPAN&gt;(&lt;SPAN style="color: #458383;"&gt;url&lt;/SPAN&gt;);
&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(&lt;SPAN style="color: #458383;"&gt;credential &lt;/SPAN&gt;&amp;amp;&amp;amp; &lt;SPAN style="color: #458383;"&gt;asset &lt;/SPAN&gt;!== &lt;SPAN style="color: #008000; font-weight: bold;"&gt;'agol'&lt;/SPAN&gt;) {
  &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;console&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;log&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;`Authentication.service.ts: logout: LOGGING OUT user: &lt;/SPAN&gt;${&lt;SPAN style="color: #458383;"&gt;credential&lt;/SPAN&gt;.&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;userId&lt;/SPAN&gt;}&lt;SPAN style="color: #008000; font-weight: bold;"&gt;. [&lt;/SPAN&gt;${&lt;SPAN style="color: #458383;"&gt;asset&lt;/SPAN&gt;}&lt;SPAN style="color: #008000; font-weight: bold;"&gt; (&lt;/SPAN&gt;${&lt;SPAN style="color: #458383;"&gt;url&lt;/SPAN&gt;}&lt;SPAN style="color: #008000; font-weight: bold;"&gt;)]`&lt;/SPAN&gt;);
  &lt;SPAN style="color: #458383;"&gt;credential&lt;/SPAN&gt;.&lt;SPAN style="color: #7a7a43;"&gt;destroy&lt;/SPAN&gt;();
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? OR do I have to do it manually ?&amp;nbsp;&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 14:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resolved-how-to-destroy-a-single-credential-from/m-p/299827#M27504</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T14:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: [RESOLVED] How to destroy a single credential from many?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resolved-how-to-destroy-a-single-credential-from/m-p/299828#M27505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems like I've had a bug there (deeper in the code), but I'll keep testing and see if this works ok.&lt;BR /&gt;&lt;BR /&gt;I do, however, have another thing to note. I initialize IdentityManager from JSON I've serialized before user closes the application. but with each new login, the &lt;STRONG&gt;credentials array keeps growing&lt;/STRONG&gt; even for the &lt;STRONG&gt;same portal and user id&lt;/STRONG&gt;. I'd have expected it to be cleaned up. But seems like I'll have to handle this myself&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Feb 2020 22:06:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/resolved-how-to-destroy-a-single-credential-from/m-p/299828#M27505</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-02-16T22:06:23Z</dc:date>
    </item>
  </channel>
</rss>

