<?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 Test Token if Valid in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/test-token-if-valid/m-p/64791#M5676</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating my own Token via aspx .net login page.&amp;nbsp; I am setting the Expiration of this Token as well.&lt;/P&gt;&lt;P&gt;Once authenticated the user is passed to an aspx page leveraging JavaScript API in a .js page to render the layers and map&lt;/P&gt;&lt;P&gt;It is here I am adding the Token to the Map Service: see below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var Data = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myserver.gov/arcgis/rest/services/Test/blers/MapServer?token=" rel="nofollow" target="_blank"&gt;https://myserver.gov/arcgis/rest/services/Test/blers/MapServer?token=&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Data += MapServerToken;&lt;/P&gt;&lt;P&gt;map.addLayer(new ArcGISDynamicMapServiceLayer(Data,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { opacity: .8 }));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the app stands idle for an extended period of time the Token will expire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way to test whether a Token is still valid or not via JavaScript?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is possible I would like to then redirect them back to a login page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone?&amp;nbsp; Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 13:10:32 GMT</pubDate>
    <dc:creator>jaykapalczynski</dc:creator>
    <dc:date>2014-08-20T13:10:32Z</dc:date>
    <item>
      <title>Test Token if Valid</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/test-token-if-valid/m-p/64791#M5676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating my own Token via aspx .net login page.&amp;nbsp; I am setting the Expiration of this Token as well.&lt;/P&gt;&lt;P&gt;Once authenticated the user is passed to an aspx page leveraging JavaScript API in a .js page to render the layers and map&lt;/P&gt;&lt;P&gt;It is here I am adding the Token to the Map Service: see below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var Data = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://myserver.gov/arcgis/rest/services/Test/blers/MapServer?token=" rel="nofollow" target="_blank"&gt;https://myserver.gov/arcgis/rest/services/Test/blers/MapServer?token=&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Data += MapServerToken;&lt;/P&gt;&lt;P&gt;map.addLayer(new ArcGISDynamicMapServiceLayer(Data,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { opacity: .8 }));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the app stands idle for an extended period of time the Token will expire.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Is there a way to test whether a Token is still valid or not via JavaScript?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is possible I would like to then redirect them back to a login page.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone?&amp;nbsp; Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 13:10:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/test-token-if-valid/m-p/64791#M5676</guid>
      <dc:creator>jaykapalczynski</dc:creator>
      <dc:date>2014-08-20T13:10:32Z</dc:date>
    </item>
  </channel>
</rss>

