<?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 Persisted Credential deleted when calling GetCredentialAsync() in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/persisted-credential-deleted-when-calling/m-p/1684440#M13861</link>
    <description>&lt;P&gt;In my startup code, I set:&lt;/P&gt;&lt;P&gt;AuthenticationManager.Persistence = await CredentialPersistence.CreateDefaultAsync("testKey");&lt;/P&gt;&lt;P&gt;This gets me an AppDataCredentialPersistance. Then I would sign-in to arcgis.com and retrieve an OAuthUserCredential, which gets added to my AuthenticationManager. Upon restarting the app, it goes to my startup code again. After stepping over the line where I set the Persistence, I can see the CredentialPersistence's _credentials field indicate that I have 1 credential for arcgis.com. My AuthenticationManager also indicates I have 1 credential stored.&lt;/P&gt;&lt;P&gt;Next I call AuthenticationManager.GetCredentialAsync(request, true), which routes the call to my IChallengeHandler.CreateCredentialAsync() implementation. For some reason, between when I make the call and the call reaching my handler, I see my AGOL credential got deleted from both AuthenticationManager and the Persistence.&lt;/P&gt;&lt;P&gt;My request was for &lt;A href="https:/www.arcgis.com," target="_blank" rel="noopener"&gt;https:///www.arcgis.com,&lt;/A&gt;&amp;nbsp;Token for AuthenticationType.&lt;/P&gt;&lt;P&gt;I found a similar report but on iOS.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/swift-maps-sdk-questions/stored-credential-is-lost-upon-app-restart/td-p/1508005" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/swift-maps-sdk-questions/stored-credential-is-lost-upon-app-restart/td-p/1508005&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Edit: If I call FindCredential before calling GetCredentialAsync, I can get my persisted credential just fine. I'm mostly looking for confirmation / documentation clarifying if GetCredentialAsync is supposed to clear stored credentials ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 14 Feb 2026 01:26:17 GMT</pubDate>
    <dc:creator>EricLiu</dc:creator>
    <dc:date>2026-02-14T01:26:17Z</dc:date>
    <item>
      <title>Persisted Credential deleted when calling GetCredentialAsync()</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/persisted-credential-deleted-when-calling/m-p/1684440#M13861</link>
      <description>&lt;P&gt;In my startup code, I set:&lt;/P&gt;&lt;P&gt;AuthenticationManager.Persistence = await CredentialPersistence.CreateDefaultAsync("testKey");&lt;/P&gt;&lt;P&gt;This gets me an AppDataCredentialPersistance. Then I would sign-in to arcgis.com and retrieve an OAuthUserCredential, which gets added to my AuthenticationManager. Upon restarting the app, it goes to my startup code again. After stepping over the line where I set the Persistence, I can see the CredentialPersistence's _credentials field indicate that I have 1 credential for arcgis.com. My AuthenticationManager also indicates I have 1 credential stored.&lt;/P&gt;&lt;P&gt;Next I call AuthenticationManager.GetCredentialAsync(request, true), which routes the call to my IChallengeHandler.CreateCredentialAsync() implementation. For some reason, between when I make the call and the call reaching my handler, I see my AGOL credential got deleted from both AuthenticationManager and the Persistence.&lt;/P&gt;&lt;P&gt;My request was for &lt;A href="https:/www.arcgis.com," target="_blank" rel="noopener"&gt;https:///www.arcgis.com,&lt;/A&gt;&amp;nbsp;Token for AuthenticationType.&lt;/P&gt;&lt;P&gt;I found a similar report but on iOS.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/swift-maps-sdk-questions/stored-credential-is-lost-upon-app-restart/td-p/1508005" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/swift-maps-sdk-questions/stored-credential-is-lost-upon-app-restart/td-p/1508005&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Edit: If I call FindCredential before calling GetCredentialAsync, I can get my persisted credential just fine. I'm mostly looking for confirmation / documentation clarifying if GetCredentialAsync is supposed to clear stored credentials ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Feb 2026 01:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/persisted-credential-deleted-when-calling/m-p/1684440#M13861</guid>
      <dc:creator>EricLiu</dc:creator>
      <dc:date>2026-02-14T01:26:17Z</dc:date>
    </item>
  </channel>
</rss>

