<?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 Bug? In a deployment experience SessionManager.SignOut always redirects to /app/page/set-portalurl in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/bug-in-a-deployment-experience-sessionmanager/m-p/1608326#M18591</link>
    <description>&lt;P&gt;I have an Experience Builder Dev Edition (1.15) app deployed to my own url &lt;A href="https://example/app" target="_blank" rel="noopener"&gt;https://example.com/app&lt;/A&gt;. It is configured for OAuth2 authentication to our portal at &lt;A href="https://example.com/portal" target="_blank" rel="noopener"&gt;https://example.com/portal&lt;/A&gt;. While sign in is working for the most part, Sign Out is not.&lt;/P&gt;&lt;P&gt;Here is the SignOut code, initiated when a user clicks on the SignOut button.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export async function signOut() {
  const sm = SessionManager.getInstance();
  sm.signOut();
}&lt;/LI-CODE&gt;&lt;P&gt;Whenever `signOut` is called my app is redirected to &lt;A href="https://example.com/app/page/set-portalurl" target="_blank" rel="noopener"&gt;https://example.com/app/page/set-portalurl&lt;/A&gt; which does not exist in our app. When running the experience via Experience Builder on localhost this makes sense, but it does not make sense for a deployed application.&lt;/P&gt;&lt;P&gt;I stepped into the signOut code at runtime and discovered the following code. I stopped execution on this.removeAuthInfo().&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanTaylor_0-1745367368142.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130771i313A07A6587A7621/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanTaylor_0-1745367368142.png" alt="RyanTaylor_0-1745367368142.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;From what I can tell, at&amp;nbsp; the end of this method Experience Builder will redirect the application to the portal signout page with a redirectUri that depends on jimuConfig properties&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If `window.jimuConfig.isDevEdition == true` then redirectUri = currentPath + "page/set-portalUrl".&lt;/LI&gt;&lt;LI&gt;else if `window.jimuConfig.isInPortal == true` then redirectUri = currentHref&lt;/LI&gt;&lt;LI&gt;else the redirectUri = protocol + host + "/page/landing"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;When I deploy the experience per &lt;A href="https://developers.arcgis.com/experience-builder/guide/deployment-topics/#automated-deployments" target="_blank" rel="noopener"&gt;esri documentation isDevEdition&lt;/A&gt; appears to be perpetually true. I think this is set in the generated index.html.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanTaylor_1-1745367952548.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130772iBCF9573B099B8EC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanTaylor_1-1745367952548.png" alt="RyanTaylor_1-1745367952548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even if I were to change this to false, there doesn't seem to be a code path that would redirect to a location of my choosing. I would be redirected to &lt;A href="https://example.com/page/landing," target="_blank" rel="noopener"&gt;https://example.com/page/landing,&lt;/A&gt; outside of my application.&lt;/P&gt;&lt;P&gt;This feels like a bug either in documentation or implementation. It would seem there should be a way to specify the redirectUri one would want on SignOut, or, at least the logic above should consider window.jimuConfig.isOutOfExb and provide an appropriate redirect back the app itself.&lt;/P&gt;&lt;P&gt;What am I doing wrong? Is this a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2025 12:22:17 GMT</pubDate>
    <dc:creator>RyanTaylor</dc:creator>
    <dc:date>2025-04-23T12:22:17Z</dc:date>
    <item>
      <title>Bug? In a deployment experience SessionManager.SignOut always redirects to /app/page/set-portalurl</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/bug-in-a-deployment-experience-sessionmanager/m-p/1608326#M18591</link>
      <description>&lt;P&gt;I have an Experience Builder Dev Edition (1.15) app deployed to my own url &lt;A href="https://example/app" target="_blank" rel="noopener"&gt;https://example.com/app&lt;/A&gt;. It is configured for OAuth2 authentication to our portal at &lt;A href="https://example.com/portal" target="_blank" rel="noopener"&gt;https://example.com/portal&lt;/A&gt;. While sign in is working for the most part, Sign Out is not.&lt;/P&gt;&lt;P&gt;Here is the SignOut code, initiated when a user clicks on the SignOut button.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;export async function signOut() {
  const sm = SessionManager.getInstance();
  sm.signOut();
}&lt;/LI-CODE&gt;&lt;P&gt;Whenever `signOut` is called my app is redirected to &lt;A href="https://example.com/app/page/set-portalurl" target="_blank" rel="noopener"&gt;https://example.com/app/page/set-portalurl&lt;/A&gt; which does not exist in our app. When running the experience via Experience Builder on localhost this makes sense, but it does not make sense for a deployed application.&lt;/P&gt;&lt;P&gt;I stepped into the signOut code at runtime and discovered the following code. I stopped execution on this.removeAuthInfo().&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanTaylor_0-1745367368142.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130771i313A07A6587A7621/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanTaylor_0-1745367368142.png" alt="RyanTaylor_0-1745367368142.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;From what I can tell, at&amp;nbsp; the end of this method Experience Builder will redirect the application to the portal signout page with a redirectUri that depends on jimuConfig properties&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If `window.jimuConfig.isDevEdition == true` then redirectUri = currentPath + "page/set-portalUrl".&lt;/LI&gt;&lt;LI&gt;else if `window.jimuConfig.isInPortal == true` then redirectUri = currentHref&lt;/LI&gt;&lt;LI&gt;else the redirectUri = protocol + host + "/page/landing"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;When I deploy the experience per &lt;A href="https://developers.arcgis.com/experience-builder/guide/deployment-topics/#automated-deployments" target="_blank" rel="noopener"&gt;esri documentation isDevEdition&lt;/A&gt; appears to be perpetually true. I think this is set in the generated index.html.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanTaylor_1-1745367952548.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/130772iBCF9573B099B8EC3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanTaylor_1-1745367952548.png" alt="RyanTaylor_1-1745367952548.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Even if I were to change this to false, there doesn't seem to be a code path that would redirect to a location of my choosing. I would be redirected to &lt;A href="https://example.com/page/landing," target="_blank" rel="noopener"&gt;https://example.com/page/landing,&lt;/A&gt; outside of my application.&lt;/P&gt;&lt;P&gt;This feels like a bug either in documentation or implementation. It would seem there should be a way to specify the redirectUri one would want on SignOut, or, at least the logic above should consider window.jimuConfig.isOutOfExb and provide an appropriate redirect back the app itself.&lt;/P&gt;&lt;P&gt;What am I doing wrong? Is this a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 12:22:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/bug-in-a-deployment-experience-sessionmanager/m-p/1608326#M18591</guid>
      <dc:creator>RyanTaylor</dc:creator>
      <dc:date>2025-04-23T12:22:17Z</dc:date>
    </item>
  </channel>
</rss>

