<?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 make JavaScript API show company specific portal login screen when trying to access secure layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1324243#M82124</link>
    <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;Thanks a lot for your response. We tried this but didn't succeed. I have the feeling this is because we didn't register our third party app correctly at ArcGIS. Do you know exactly how to register this third party app (so has a URL not related to ArcGIS) with ArcGIS?&lt;/P&gt;&lt;P&gt;We tried following&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/arcgis-online/manage-data/add-app-url.htm#REG_APP" target="_blank"&gt;https://doc.arcgis.com/en/arcgis-online/manage-data/add-app-url.htm#REG_APP&lt;/A&gt;&lt;/P&gt;&lt;P&gt;section 'Add and register an app using developer credentials'. There also a Client Secret is mentioned. That confuses me, because nowhere I need to enter this if I look at the JavaScript code you shared.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Aug 2023 08:43:14 GMT</pubDate>
    <dc:creator>IvoSturm</dc:creator>
    <dc:date>2023-08-31T08:43:14Z</dc:date>
    <item>
      <title>How to make JavaScript API show company specific portal login screen when trying to access secure layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1250111#M79990</link>
      <description>&lt;P&gt;Dear fellow developers,&lt;/P&gt;&lt;P&gt;I have written a webapp with the ArcGIS JavaScript API and all is working fine. Now I am trying to add secured layers to the web app and the app starts asking for credentials via a default login screen. I could use that, just entering username and password, but most users don't know their user name and password for ArcGIS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvoSturm_0-1674250696920.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60888i428403420C58CA61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvoSturm_0-1674250696920.png" alt="IvoSturm_0-1674250696920.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The company has implemented SSO with ArcGIS so users don't have to fill in their credentials. Users typically go to the main company.maps.arcgis.com site and get to a company specific login screen where they have the option to click this SSO button.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="IvoSturm_1-1674250706028.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/60889i6B35F37D5F67EF7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="IvoSturm_1-1674250706028.png" alt="IvoSturm_1-1674250706028.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question; how can I make the JavaScript API show this company specific login page with SSO button instead of the default one?&lt;/P&gt;&lt;P&gt;I tried registering oauthInfo and serverInfo setting but without success....&lt;/P&gt;&lt;P&gt;Did anybody else ever built this?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 21:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1250111#M79990</guid>
      <dc:creator>IvoSturm</dc:creator>
      <dc:date>2023-01-20T21:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to make JavaScript API show company specific portal login screen when trying to access secure layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1250121#M79991</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello&lt;BR /&gt;This does require oAuth and you need to register your app with your Portal/AGO instance. Once you register it you get the app id and add it to your oAuth configuration in your app.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var oauthInfo;
//get oauthInfo
oauthInfo = new OAuthInfo({
appId: &amp;lt;app id here&amp;gt;,
portalUrl: &amp;lt;portal url here&amp;gt;,
popup: true
});

esriId.registerOAuthInfos([oauthInfo]);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Then, when you load your secure layer you pass in the portal you are accessing it from...if it's a secured layer the login dialog will popup for that portal:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Layer.fromPortalItem({
portalItem: {
// autocasts as new PortalItem()
id: &amp;lt;item id here&amp;gt;,
portal: new.Portal({ url: &amp;lt;portal or ago url here&amp;gt; });

}
})
.then(function (layer) {

})
.catch(rejection);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope that helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;!--   end error description   --&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 23:20:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1250121#M79991</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2023-01-20T23:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to make JavaScript API show company specific portal login screen when trying to access secure layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1324243#M82124</link>
      <description>&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;Thanks a lot for your response. We tried this but didn't succeed. I have the feeling this is because we didn't register our third party app correctly at ArcGIS. Do you know exactly how to register this third party app (so has a URL not related to ArcGIS) with ArcGIS?&lt;/P&gt;&lt;P&gt;We tried following&amp;nbsp;&lt;A href="https://doc.arcgis.com/en/arcgis-online/manage-data/add-app-url.htm#REG_APP" target="_blank"&gt;https://doc.arcgis.com/en/arcgis-online/manage-data/add-app-url.htm#REG_APP&lt;/A&gt;&lt;/P&gt;&lt;P&gt;section 'Add and register an app using developer credentials'. There also a Client Secret is mentioned. That confuses me, because nowhere I need to enter this if I look at the JavaScript code you shared.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 08:43:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1324243#M82124</guid>
      <dc:creator>IvoSturm</dc:creator>
      <dc:date>2023-08-31T08:43:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to make JavaScript API show company specific portal login screen when trying to access secure layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1324325#M82128</link>
      <description>&lt;P&gt;In ArcGIS Online you need to add your app to your content.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Content &amp;gt; New Item -&amp;gt; Application&lt;/P&gt;&lt;P&gt;Then choose 'Web Mapping' -&amp;gt; enter the URL -&amp;gt; Next.&amp;nbsp; Then enter the details to the app and then add it to your content.&amp;nbsp; Once it's added click 'Settings' on your newly added item details page and scroll to the bottom.&amp;nbsp; Click 'Register' and enter the redirect URL (usually just the main URL), then click 'Register'.&amp;nbsp; This will then generate a client ID that you use in the code.&lt;/P&gt;&lt;P&gt;Here's a sample app:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Follow the links on this page to learn more about OAuth for the JSAPI.&lt;/P&gt;&lt;P&gt;Lastly...you will also need the oauth_callback.html page a the root of your app url.&amp;nbsp; See the ESRI github docs here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/jsapi-resources/blob/main/oauth/oauth-callback.html" target="_blank"&gt;https://github.com/Esri/jsapi-resources/blob/main/oauth/oauth-callback.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 13:28:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-make-javascript-api-show-company-specific/m-p/1324325#M82128</guid>
      <dc:creator>MichaelSnook</dc:creator>
      <dc:date>2023-08-31T13:28:47Z</dc:date>
    </item>
  </channel>
</rss>

