<?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 Using IWA with javascript application hosted on server that is not used by ArcGIS Enterprise in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1081849#M73987</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For some reason I think this should be more straight forward.&amp;nbsp; What we need to do is access a secure service on our ArcGIS Enterprise installation from a map built using the javascript API.&lt;/P&gt;&lt;P&gt;If I host the web application on the same server as the ArcGIS Enterprise installation, everything works without any issue.&amp;nbsp; Do not even have to do anything with IdentityManager.&amp;nbsp; Looking at fiddler I can see that the requests are challenged with a 401 response and then another call is made passing in the required Negotiate security header.&lt;/P&gt;&lt;P&gt;However, this is no longer the case when hosting the application on a different web server, also within the same domain.&amp;nbsp; Looking at fiddler in this case the same initial 401 response, however, in these cases (I have tried a number of servers) the follow-up request with the Negotiate header is never sent.&lt;/P&gt;&lt;P&gt;I have tried too many things to even describe basically following numerous examples of how one would use IdentityManager to request credentials.&lt;/P&gt;&lt;P&gt;These all take the general form of&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const server = portalUrl + '/sharing/rest';
    const tokenServiceUrl = server + '/generateToken';

    const serverInfo = {
        tokenServiceUrl
    };

    const userInfo = {
        username,
        password
    };

    esriId.generateToken(serverInfo, userInfo).then((tokenInfo) =&amp;gt; {
        esriId.registerToken({tokenInfo, server})
    }, (error) =&amp;gt; {
        console.log(error);
    }).catch(() =&amp;gt; {
        console.log("hello");
    });&lt;/LI-CODE&gt;&lt;P&gt;In this case what is observed is that the request to the generateToken endpoint returns a 401 response but again the follow-up request with the Negotiate header is never sent.&lt;/P&gt;&lt;P&gt;I am at my wits end.&amp;nbsp; Hosting the web application on the ArcGIS Enterprise server in our production environment is likely not possible so we need a way to do from a separate server&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jul 2021 17:21:19 GMT</pubDate>
    <dc:creator>JoeHershman</dc:creator>
    <dc:date>2021-07-22T17:21:19Z</dc:date>
    <item>
      <title>Using IWA with javascript application hosted on server that is not used by ArcGIS Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1081849#M73987</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For some reason I think this should be more straight forward.&amp;nbsp; What we need to do is access a secure service on our ArcGIS Enterprise installation from a map built using the javascript API.&lt;/P&gt;&lt;P&gt;If I host the web application on the same server as the ArcGIS Enterprise installation, everything works without any issue.&amp;nbsp; Do not even have to do anything with IdentityManager.&amp;nbsp; Looking at fiddler I can see that the requests are challenged with a 401 response and then another call is made passing in the required Negotiate security header.&lt;/P&gt;&lt;P&gt;However, this is no longer the case when hosting the application on a different web server, also within the same domain.&amp;nbsp; Looking at fiddler in this case the same initial 401 response, however, in these cases (I have tried a number of servers) the follow-up request with the Negotiate header is never sent.&lt;/P&gt;&lt;P&gt;I have tried too many things to even describe basically following numerous examples of how one would use IdentityManager to request credentials.&lt;/P&gt;&lt;P&gt;These all take the general form of&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    const server = portalUrl + '/sharing/rest';
    const tokenServiceUrl = server + '/generateToken';

    const serverInfo = {
        tokenServiceUrl
    };

    const userInfo = {
        username,
        password
    };

    esriId.generateToken(serverInfo, userInfo).then((tokenInfo) =&amp;gt; {
        esriId.registerToken({tokenInfo, server})
    }, (error) =&amp;gt; {
        console.log(error);
    }).catch(() =&amp;gt; {
        console.log("hello");
    });&lt;/LI-CODE&gt;&lt;P&gt;In this case what is observed is that the request to the generateToken endpoint returns a 401 response but again the follow-up request with the Negotiate header is never sent.&lt;/P&gt;&lt;P&gt;I am at my wits end.&amp;nbsp; Hosting the web application on the ArcGIS Enterprise server in our production environment is likely not possible so we need a way to do from a separate server&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 17:21:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1081849#M73987</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-07-22T17:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using IWA with javascript application hosted on server that is not used by ArcGIS Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1082703#M74015</link>
      <description>&lt;P&gt;So has no one ever done this (successfully)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyone at esri that has insight to this issue?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/349741"&gt;@JoseBanuelos&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/180"&gt;@AndyGup&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/11373"&gt;@JohnGrayson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 16:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1082703#M74015</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-07-27T16:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using IWA with javascript application hosted on server that is not used by ArcGIS Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1083149#M74031</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7529"&gt;@JoeHershman&lt;/a&gt;&amp;nbsp;on the surface this sounds like a configuration issue within your environment. Can you open a support ticket? They can review your configuration in detail, there could be quite a few variables in play that are best investigated in a one-on-one support setting.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 17:27:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-iwa-with-javascript-application-hosted-on/m-p/1083149#M74031</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-07-27T17:27:49Z</dc:date>
    </item>
  </channel>
</rss>

