<?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: Token Required for Attachments: How to obtain token for popup links? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590695#M55188</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as both pages are on the same domain and you can modify the JavaScript code of the second page, you can pass the credential information via a &lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/cookie.html"&gt;cookie &lt;/A&gt;or the browsers &lt;A href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage"&gt;local storage&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can extract the data from &lt;A href="https://developers.arcgis.com/javascript/jsapi/identitymanager-amd.html#tojson"&gt;IdentityManager.toJson()&lt;/A&gt;, and then pass it back in with &lt;A href="https://developers.arcgis.com/javascript/jsapi/identitymanager-amd.html#initialize"&gt;IdentityManager.initialize()&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these are on different domains but you are able to modify the code, you could always pass the token and the rest of the required data through the URL as GET parameters, but you will be exposing this information to the end-user which may lead to security issues. This method also means that you have to deconstruct and re-build the Identity Manager state objects yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, if you have no control over the second (e.g. an ArcGIS Online page), you are out of luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Nov 2014 20:53:04 GMT</pubDate>
    <dc:creator>DavidBlanchard</dc:creator>
    <dc:date>2014-11-27T20:53:04Z</dc:date>
    <item>
      <title>Token Required for Attachments: How to obtain token for popup links?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590694#M55187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have been developing a mobile application that is utilizing some secured services from ArcGIS.com.&amp;nbsp; I have been able to access them pretty easily using app login described in this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jshelp/tutorial_sharing_maps_secure_layers.html"&gt;https://developers.arcgis.com/javascript/jshelp/tutorial_sharing_maps_secure_layers.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I noticed that although the layers authenticate and display on the map properly the attachment links within the standard popup window open another tab and then display a token required page rather than the image or attachment.&amp;nbsp; At this point I am unsure exactly how to proceed. I imagine I would need to somehow append a token to the attachment url which is easy enough however I am unsure of how to properly obtain the token or if that is even how to do it the right way.&amp;nbsp; Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Isaiah Aguilera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2014 21:10:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590694#M55187</guid>
      <dc:creator>IsaiahAguilera</dc:creator>
      <dc:date>2014-11-26T21:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Token Required for Attachments: How to obtain token for popup links?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590695#M55188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as both pages are on the same domain and you can modify the JavaScript code of the second page, you can pass the credential information via a &lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/cookie.html"&gt;cookie &lt;/A&gt;or the browsers &lt;A href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage"&gt;local storage&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can extract the data from &lt;A href="https://developers.arcgis.com/javascript/jsapi/identitymanager-amd.html#tojson"&gt;IdentityManager.toJson()&lt;/A&gt;, and then pass it back in with &lt;A href="https://developers.arcgis.com/javascript/jsapi/identitymanager-amd.html#initialize"&gt;IdentityManager.initialize()&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If these are on different domains but you are able to modify the code, you could always pass the token and the rest of the required data through the URL as GET parameters, but you will be exposing this information to the end-user which may lead to security issues. This method also means that you have to deconstruct and re-build the Identity Manager state objects yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lastly, if you have no control over the second (e.g. an ArcGIS Online page), you are out of luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2014 20:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590695#M55188</guid>
      <dc:creator>DavidBlanchard</dc:creator>
      <dc:date>2014-11-27T20:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Token Required for Attachments: How to obtain token for popup links?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590696#M55189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately I think I am in the out of luck section.&amp;nbsp; The "second page" as you put it is just a new browser tab that displays the attachment image from ArcGIS Online.&amp;nbsp; I am not sure how to go about modifying this in any way besides modifying the attachment URL that is loaded, I am going to have to try and investigate this further.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Isaiah Aguilera&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 18:04:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/token-required-for-attachments-how-to-obtain-token/m-p/590696#M55189</guid>
      <dc:creator>IsaiahAguilera</dc:creator>
      <dc:date>2014-12-03T18:04:10Z</dc:date>
    </item>
  </channel>
</rss>

