<?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: Creating Layer with Auth Token : How do I keep it connected? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1671997#M13304</link>
    <description>&lt;P&gt;Have you tried the out-of-the-box functionality&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/sdk/api-reference/topic11811.html" target="_self"&gt;CreateLayer?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You probably need to look into&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/sdk/api-reference/topic14671.html" target="_self"&gt;ArcGISPortal&amp;nbsp;&lt;/A&gt;class for the Pro Addin or&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/sdk/api-reference/topic25949.html" target="_self"&gt;IArcGISSignOn&amp;nbsp;&lt;/A&gt; for the CoreHost app for advanced token handling. Also,&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/help/projects/sign-in-to-your-organization.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/3.3/help/projects/sign-in-to-your-organization.htm&lt;/A&gt;&amp;nbsp;is worth looking at.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Dec 2025 16:30:22 GMT</pubDate>
    <dc:creator>Aashis</dc:creator>
    <dc:date>2025-12-10T16:30:22Z</dc:date>
    <item>
      <title>Creating Layer with Auth Token : How do I keep it connected?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1670678#M13296</link>
      <description>&lt;P&gt;I'm using CreateLayer in my Add-In and passing an auth token to create a layer from a REST Map Server.&lt;/P&gt;&lt;P&gt;The issue I'm having is that after the token times out, the layers will no longer work and they have to create the layers again through a ribbon button I provided.&lt;/P&gt;&lt;P&gt;Is there a way to force the token to be generated after a timeout? Maybe I can receive an event in the add-in??? I just have no idea what to search for to make this happen.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 20:25:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1670678#M13296</guid>
      <dc:creator>TomLewis</dc:creator>
      <dc:date>2025-12-04T20:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layer with Auth Token : How do I keep it connected?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1670772#M13297</link>
      <description>&lt;P&gt;Use the SDK’s Authentication/Identity manager (AuthenticationManager / IdentityManager / ArcGISIdentityManager depending on product &amp;amp; API) and &lt;EM&gt;register&lt;/EM&gt; credentials with it. The SDK will then attach credentials to requests and will call a registered challenge/callback when a token is rejected so your code can obtain a fresh token (or the SDK will handle refresh if you used an OAuth flow that issues refresh tokens). This is the usual, robust pattern.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var serviceUri = new Uri("https://myserver.example.com/arcgis/rest/services");
string token = await GetAccessTokenFromYourServerAsync(); // your token fetch
var expires = DateTimeOffset.UtcNow.AddMinutes(30); // use the expiry the token endpoint returned

// PregeneratedTokenCredential / AccessTokenCredential or similar depending on SDK
var credential = new PregeneratedTokenCredential(token, serviceUri, expires);
AuthenticationManager.Current.AddCredential(credential);&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 Dec 2025 03:02:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1670772#M13297</guid>
      <dc:creator>SumitMishra_016</dc:creator>
      <dc:date>2025-12-05T03:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layer with Auth Token : How do I keep it connected?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1671651#M13301</link>
      <description>&lt;P&gt;Thanks for that. Is this relative to ArcGIS Pro SDK 3.3? I can't find anything like the TokenCredential classes.&lt;/P&gt;&lt;P&gt;Also, where would this code go if I could get it to work? Module Initialize?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2025 16:22:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1671651#M13301</guid>
      <dc:creator>TomLewis</dc:creator>
      <dc:date>2025-12-09T16:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layer with Auth Token : How do I keep it connected?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1671997#M13304</link>
      <description>&lt;P&gt;Have you tried the out-of-the-box functionality&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/sdk/api-reference/topic11811.html" target="_self"&gt;CreateLayer?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You probably need to look into&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/sdk/api-reference/topic14671.html" target="_self"&gt;ArcGISPortal&amp;nbsp;&lt;/A&gt;class for the Pro Addin or&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/sdk/api-reference/topic25949.html" target="_self"&gt;IArcGISSignOn&amp;nbsp;&lt;/A&gt; for the CoreHost app for advanced token handling. Also,&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/3.3/help/projects/sign-in-to-your-organization.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/3.3/help/projects/sign-in-to-your-organization.htm&lt;/A&gt;&amp;nbsp;is worth looking at.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2025 16:30:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1671997#M13304</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2025-12-10T16:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Layer with Auth Token : How do I keep it connected?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1672000#M13305</link>
      <description>&lt;P&gt;I use CreateLayer with passing a token to create the layers initially and don't see anything that can handle the token timeouts related directly to CreateLayer. I'll look at those links.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2025 16:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/creating-layer-with-auth-token-how-do-i-keep-it/m-p/1672000#M13305</guid>
      <dc:creator>TomLewis</dc:creator>
      <dc:date>2025-12-10T16:34:41Z</dc:date>
    </item>
  </channel>
</rss>

