<?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: Authentication token is not being appended to urls in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114156#M10662</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;so attempting to append a token onto the request is not going to work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Did you try this?&amp;nbsp; If you append a token to a URL (whether a layer or a task like GP), that should work fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Aug 2015 22:52:01 GMT</pubDate>
    <dc:creator>BjornSvensson</dc:creator>
    <dc:date>2015-08-26T22:52:01Z</dc:date>
    <item>
      <title>Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114153#M10659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using javascript api to access some secure map and GP services, but am having a lot of problems with tokens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using &lt;A href="https://developers.arcgis.com/javascript/jsapi/identitymanager-amd.html"&gt;IdentityManager&lt;/A&gt; to generate tokens is working fine, and I can store them off in a cookie or local storage (as in &lt;A href="https://developers.arcgis.com/javascript/jssamples/widget_identitymanager_client_side.html"&gt;this&lt;/A&gt; sample). However, when I try and load a map service, the console shows Error: Token Required and I get a credential popup over the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to avoid this and have a single sign-on to the site (the user has already signed in on a previous page, so should be able to load services without entering more credentials).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Authenticating a second time in the browser might be ok, but I'm then running some GP services and calls to getResultData fail with the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both cases, the call stack leads deep into init.js, so attempting to append a token onto the request is not going to work. What am I doing wrong here? If I've authenticated with IdentityManager, shouldn't all subsequent calls have a token attached?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 15:52:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114153#M10659</guid>
      <dc:creator>JonMorris2</dc:creator>
      <dc:date>2015-08-20T15:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114154#M10660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I couldn't get IdentityManager to work, but I did update the proxy to get a token from the cookie if none is given. The code can be found &lt;A href="https://github.com/jontwo/resource-proxy"&gt;here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GetResultData works now, but when you pass this result as an input into a second GP Service, it still fails before starting. The inputs are valid, but it just returns esriJobFailed - the log doesn't even get as far as "Executing [args], Start Time, etc."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've run the same services successfully on an unsecured server, so maybe it just doesn't work on a secure server.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 08:10:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114154#M10660</guid>
      <dc:creator>JonMorris2</dc:creator>
      <dc:date>2015-08-25T08:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114155#M10661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; If I've authenticated with IdentityManager, shouldn't all subsequent calls have a token attached?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;No, the IdentityManager will only use tokens when it thinks it is needed. That's not the same as "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;all subsequent calls".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 21:41:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114155#M10661</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2015-08-26T21:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114156#M10662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;so attempting to append a token onto the request is not going to work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Did you try this?&amp;nbsp; If you append a token to a URL (whether a layer or a task like GP), that should work fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2015 22:52:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114156#M10662</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2015-08-26T22:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114157#M10663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Bjorn Svensson:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;so attempting to append a token onto the request is not going to work&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Did you try this?&amp;nbsp; If you append a token to a URL (whether a layer or a task like GP), that should work fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry, what I meant was attempting it in javascript. Changing the code on my site isn't going to help when the call is coming from somewhere in the Esri js code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I did was alter the proxy code to append the token (as you've seen in my &lt;A href="https://github.com/Esri/resource-proxy/pull/288"&gt;pull request&lt;/A&gt;). This appears to work - I can access my map and GP services - but even after retrieving the result data, passing it into a second service fails.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 08:06:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114157#M10663</guid>
      <dc:creator>JonMorris2</dc:creator>
      <dc:date>2015-08-27T08:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114158#M10664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Bjorn Svensson:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; line-height: 1.5;"&gt;IdentityManager will only use tokens &lt;STRONG&gt;when it thinks it is needed&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, I think that's the problem. IdentityManager is getting it wrong and not appending a token when it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 08:07:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114158#M10664</guid>
      <dc:creator>JonMorris2</dc:creator>
      <dc:date>2015-08-27T08:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114159#M10665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think maybe you misunderstood my suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your JSAPI application, you can append the token to the MapService URL, and the JSAPI will send it along:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA_secure_user1/MapServer?token=" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/USA_secure_user1/MapServer?token=&lt;/A&gt;&lt;SPAN&gt;?" + token);&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Aug 2015 00:28:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114159#M10665</guid>
      <dc:creator>BjornSvensson</dc:creator>
      <dc:date>2015-08-29T00:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114160#M10666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The GP service is more of a problem for us than the map service. Do we do the same thing with the GP service URL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14410978670445881" data-renderedposition="50_8_912_32" jivemacro_uid="_14410978670445881" modifiedtitle="true"&gt;&lt;P&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; gp &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #333333; font-weight: bold;"&gt;new&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #595959;"&gt; &lt;/SPAN&gt;&lt;SPAN class="typ" style="color: #000000;"&gt;Geoprocessor&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #dd1144;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_Currents_World/GPServer/MessageInABottle?token=" rel="nofollow" target="_blank"&gt;http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_Currents_World/GPServer/MessageInABottle?token=&lt;/A&gt;&lt;SPAN&gt;" + token&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error that occurs is in the JSAPI code that runs after you call gp.SubmitJob and gp.GetResultData.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Sep 2015 08:59:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114160#M10666</guid>
      <dc:creator>JonMorris2</dc:creator>
      <dc:date>2015-09-01T08:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Authentication token is not being appended to urls</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114161#M10667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bjorn,&lt;/P&gt;&lt;P&gt;I think I'm seeing similar behavior (Feature Layers are not called with Tokens) with ArcGIS Online.&amp;nbsp; I DO have an IdentityManager populated with a user token value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;It appears that ArcGIS Online does not check the IdentityManager object before attempting to load Feature Layers without a token (at least for HTTP).&amp;nbsp; Can you confirm this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The initial request for a layer looks something like this (the actual layers are accessed via HTTP on an organizational ArcGIS Online account):&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;servicesX.arcgis.com/ORGANIZATION_CODE/arcgis/rest/services/FEATURESERVICE_NAME/FeatureServer/LAYER_ID_NUMBER?f=json&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This request "fails" with this response:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"error":{"code":499,"message":"Token Required","messageCode":"GWM_0003","details":["Token Required"]}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moments later (immediately it seems) the same request is re-issued with the appropriate token (drawn from the IdentityManager object previously created):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;servicesX.arcgis.com/ORGANIZATION_CODE/arcgis/rest/services/FEATURESERVICE_NAME/FeatureServer/LAYER_ID_NUMBER?f=json&lt;SPAN style="font-family: Helvetica, sans-serif;"&gt;&amp;amp;token=TOKEN&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;The second request with the TOKEN value succeeds and the only notice that the first request "failed" is in the console log (seen in Chrome Dev Tools).&amp;nbsp; The console log looks like this (one Error per Feature Layer load attempt):&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error: Token Required(…)x @ init.js:182(anonymous function) @ init.js:181c @ init.js:66d @ init.js:66resolve.callback @ init.js:67c @ init.js:66d @ init.js:66resolve.callback @ init.js:67c @ init.js:66d @ init.js:66resolve.callback @ init.js:67c @ init.js:66d @ init.js:66resolve.callback @ init.js:67(anonymous function) @ init.js:185k @ init.js:189m @ init.js:189resolve @ init.js:191a @ init.js:190k @ init.js:190m @ init.js:189resolve @ init.js:191a @ init.js:190k @ init.js:190m @ init.js:189resolve @ init.js:191a @ init.js:190k @ init.js:190m @ init.js:189resolve @ init.js:191q @ init.js:150f @ init.js:154&lt;/P&gt;&lt;P&gt;init.js:182 Error: Token Required(…)x @ init.js:182(anonymous function) @ init.js:181c @ init.js:66d @ init.js:66resolve.callback @ init.js:67c @ init.js:66d @ init.js:66resolve.callback @ init.js:67c @ init.js:66d @ init.js:66resolve.callback @ init.js:67c @ init.js:66d @ init.js:66resolve.callback @ init.js:67(anonymous function) @ init.js:185k @ init.js:189m @ init.js:189resolve @ init.js:191a @ init.js:190k @ init.js:190m @ init.js:189resolve @ init.js:191a @ init.js:190k @ init.js:190m @ init.js:189resolve @ init.js:191a @ init.js:190k @ init.js:190m @ init.js:189resolve @ init.js:191q @ init.js:150f @ init.js:154&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;It appears that ArcGIS Online does not check the IdentityManager object before attempting to load Feature Layers without a token (at least for HTTP).&amp;nbsp; Can you confirm this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; font-family: Helvetica, sans-serif;"&gt;Andrew&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 18:28:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/authentication-token-is-not-being-appended-to-urls/m-p/114161#M10667</guid>
      <dc:creator>AndrewMurdoch</dc:creator>
      <dc:date>2015-11-16T18:28:39Z</dc:date>
    </item>
  </channel>
</rss>

