<?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: How do I refresh access token in OAuthUserCredential? in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-i-refresh-access-token-in/m-p/1608610#M13503</link>
    <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;How do I refresh the access token within this credential? Or is that built in?&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;It's built-in.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;If it's built in, can I get a notification that the access token has refreshed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;The persistence datasource should automatically get notified if a credential gets updated, so that you can re-save the credential.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2025 17:21:07 GMT</pubDate>
    <dc:creator>dotMorten_esri</dc:creator>
    <dc:date>2025-04-23T17:21:07Z</dc:date>
    <item>
      <title>How do I refresh access token in OAuthUserCredential?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-i-refresh-access-token-in/m-p/1608373#M13498</link>
      <description>&lt;P&gt;OAuthTOKENCredential has a RefreshTokenAsync()&lt;/P&gt;&lt;P&gt;That one was deprecated in 200.6 in favor of&amp;nbsp;OAuthUserCredential. How do I refresh the access token within this credential? Or is that built in?&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it's built in, can I get a notification that the access token has refreshed?&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;I have now found docs for&amp;nbsp;OAuthUserCredential.GetTokenInfoAsync():&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;If the access token has expired, this method regenerates it. If the&amp;nbsp; AuthUserConfiguration.RefreshTokenExchangeInterval is set, this method exchanges the refresh token at specified interval. While regenerating the access token or exchanging the refresh token, if the refresh&amp;nbsp;token is expired, an exception will be thrown.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;We store the creds in a custom CredentialPersistence that saves the data locally on device. What would be a recommended flow for an app that is offline 10% of the time? Do I need to call into&amp;nbsp;GetTokenInfoAsync() at least once to kick off the token refresh? Should I call&amp;nbsp;GetTokenInfoAsync() every time the app comes online?&lt;/P&gt;&lt;P&gt;Regarding my earlier question about notifying when the token refreshed - we use the ArcGIS access token to authenticate to a custom API running a SignalR hub as well, and we need to restart the connection when the token is refreshed. With&amp;nbsp;OAuthTOKENCredential the app would refresh the token manually and we'd restart the SignalR connection.&lt;/P&gt;&lt;P&gt;I now see that call to&amp;nbsp;GetTokenInfoAsync() does not refresh the token if it's not expired. How can I either force the refresh or get notified when the token is actually refreshed?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 09:54:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-do-i-refresh-access-token-in/m-p/1608373#M13498</guid>
      <dc:creator>ViktorSafar</dc:creator>
      <dc:date>2025-04-23T09:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I refresh access token in OAuthUserCredential?</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-do-i-refresh-access-token-in/m-p/1608610#M13503</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;How do I refresh the access token within this credential? Or is that built in?&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;It's built-in.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;If it's built in, can I get a notification that the access token has refreshed?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;The persistence datasource should automatically get notified if a credential gets updated, so that you can re-save the credential.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2025 17:21:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-do-i-refresh-access-token-in/m-p/1608610#M13503</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2025-04-23T17:21:07Z</dc:date>
    </item>
  </channel>
</rss>

