<?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: how to logout from portal in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1098373#M74672</link>
    <description>&lt;P&gt;Yes, thanks, this works for me:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;IdentityManager.destroyCredentials();&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 15 Sep 2021 10:26:28 GMT</pubDate>
    <dc:creator>Arpa_PiemonteGeoportal_Team</dc:creator>
    <dc:date>2021-09-15T10:26:28Z</dc:date>
    <item>
      <title>how to logout from portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1097945#M74661</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I can log in into my portal, but I cannot log out.&lt;/P&gt;&lt;P&gt;The log in starts after click a bottom.&lt;/P&gt;&lt;P&gt;This is my code (from &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#methods-summary" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html#methods-summary&lt;/A&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;// load the Portal and PortalQueryParams modules
require(["esri/portal/Portal",
 "esri/portal/PortalQueryParams"
], function(Portal, PortalQueryParams) {
  portal = new Portal();
  // Setting authMode to immediate signs the user in once loaded
  portal.authMode = "immediate";

  // Once portal is loaded, user signed in
  portal.load().then(function() {
    console.log(portal);

    // Create query parameters for the portal search
    // This object autocasts as new PortalQueryParams()
    let queryParams = {
      query: "owner:" + portal.user.username,
      sortField: "numViews",
      sortOrder: "desc",
      num: 20
    };
    // Query the items based on the queryParams created from portal above
    portal.queryItems(queryParams).then(createGallery);
  });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Then the login windows is opened:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Arpa_PiemonteGeoportal_Team_0-1631607897038.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/22916i7A986A3C66195EB0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Arpa_PiemonteGeoportal_Team_0-1631607897038.png" alt="Arpa_PiemonteGeoportal_Team_0-1631607897038.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And all works fine, I insert my credential and I can work with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then I want to log out to consent to other users to login, but I can't find in the documentation the way.&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    portal.user = null
    portal.cancelLoad()     
    portal = false
    delete portal;&lt;/LI-CODE&gt;&lt;P&gt;But if I click the login bottom, the login windows doesn't appear and the old user is already connected!&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 08:35:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1097945#M74661</guid>
      <dc:creator>Arpa_PiemonteGeoportal_Team</dc:creator>
      <dc:date>2021-09-14T08:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to logout from portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1098083#M74667</link>
      <description>&lt;P&gt;Portal load kicks in the IdentityManager authentication workflow. So you can use the IdentityManager destroyCredentials() method to sign out.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#destroyCredentials" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-IdentityManager.html#destroyCredentials&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Sep 2021 15:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1098083#M74667</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-09-14T15:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to logout from portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1098373#M74672</link>
      <description>&lt;P&gt;Yes, thanks, this works for me:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;IdentityManager.destroyCredentials();&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Sep 2021 10:26:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-logout-from-portal/m-p/1098373#M74672</guid>
      <dc:creator>Arpa_PiemonteGeoportal_Team</dc:creator>
      <dc:date>2021-09-15T10:26:28Z</dc:date>
    </item>
  </channel>
</rss>

