<?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: Implementing app authentication with client secret in Runtime SDK 200.7 in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652777#M13689</link>
    <description>&lt;P&gt;Thank you both for the prompt answers!&lt;/P&gt;</description>
    <pubDate>Wed, 24 Sep 2025 12:59:09 GMT</pubDate>
    <dc:creator>azlotin</dc:creator>
    <dc:date>2025-09-24T12:59:09Z</dc:date>
    <item>
      <title>Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652280#M13684</link>
      <description>&lt;P&gt;I have the following working Runtime SDK 100.x code implements application authentication:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ServerInfo serverInfo = new ServerInfo&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ServerUri = new Uri(SERVER_URL),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;OAuthClientInfo = new OAuthClientInfo { ClientId = CLIENT_ID, ClientSecret = CLIENT_SECRET, RedirectUri = new Uri(REDIRECT_URL) }&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AuthenticationManager.Current.RegisterServer(serverInfo);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AuthenticationManager.Current.OAuthAuthorizeHandler = new OAuthAuthorize();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(CreateCredentialAsync);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As OAuthClientInfo is obsolete at 200.7, I have rewritten this as:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ServerInfo serverInfo = new ServerInfo(new Uri(SERVER_URL))&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;AuthenticationManager.Current.RegisterServer(serverInfo);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var userConfig = new OAuthUserConfiguration(new Uri(SERVER_URL), CLIENT_ID, new Uri(REDIRECT_URL));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AuthenticationManager.Current.OAuthUserConfigurations.Add(userConfig);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AuthenticationManager.Current.OAuthAuthorizeHandler = new OAuthAuthorize();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(CreateCredentialAsync);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;How do I include Client Secret here so the users are not getting the authentication prompt? I understand I should be using OAuthApplicationCredential, but I cannot figure out how.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 01:03:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652280#M13684</guid>
      <dc:creator>azlotin</dc:creator>
      <dc:date>2025-09-23T01:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652522#M13686</link>
      <description>&lt;P&gt;Here is the detailed blog post that explain usage of new auth APIs and how to best use them&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.esri.com/arcgis-blog/products/sdk-net/developers/new-auth-apis-for-dotnet-sdk" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/sdk-net/developers/new-auth-apis-for-dotnet-sdk&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please give this a read, especially `Configuring OAuth` section that particularly talks about OAuth. &lt;SPAN&gt;For&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;OAuth app&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;authentication, pass client ID and client secret directly to&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/net/api-reference/api/netwin/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Security.OAuthApplicationCredential.CreateAsync.html" target="_blank"&gt;OAuthApplicationCredential.CreateAsync&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 16:51:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652522#M13686</guid>
      <dc:creator>PreetiMaske</dc:creator>
      <dc:date>2025-09-23T16:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652636#M13687</link>
      <description>&lt;P&gt;To add to Preeti's answer, ALL of the above code can be replaced with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;AuthenticationManager.Current.AddCredential(await OAuthApplicationCredential.CreateAsync(SERVER_URL, CLIENT_ID, CLIENT_SECRET));&lt;/LI-CODE&gt;&lt;P&gt;When using an app credential added up front, there's no need for messing with server infos, oauth configs, credential callbacks etc. Just the above line before accessing your server.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Sep 2025 21:33:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652636#M13687</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2025-09-23T21:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652777#M13689</link>
      <description>&lt;P&gt;Thank you both for the prompt answers!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Sep 2025 12:59:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1652777#M13689</guid>
      <dc:creator>azlotin</dc:creator>
      <dc:date>2025-09-24T12:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1664780#M13772</link>
      <description>&lt;P&gt;Hi Morten,&lt;/P&gt;&lt;P&gt;I spoke too soon back in September. The single line of code you suggested does not appear to work. The line executes without any errors, but the map remains empty, with no layers loaded. This is the behavior when debugging in Visual Studio. If the application is deployed to another machine using an installer, the map is not loaded either and the application crashes a few seconds later.&lt;/P&gt;&lt;P&gt;The lengthy version of the code in my original post does not throw any errors but brings up the portal login prompt.&lt;/P&gt;&lt;P&gt;Any ideas? Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 22:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1664780#M13772</guid>
      <dc:creator>azlotin</dc:creator>
      <dc:date>2025-11-10T22:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1664781#M13773</link>
      <description>&lt;P&gt;When you say they don't load, what load errors do you see? (observe the errors coming from LoadAsync, or just look in the debug output window where load errors should also be written)&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2025 22:44:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1664781#M13773</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2025-11-10T22:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1664948#M13774</link>
      <description>&lt;P&gt;Thanks Morten, there are indeed errors in the Output window (see below). Not sure what this means. Do Client Id and Client Secret need to be updated? They are the same as in the original 100.x application.&lt;/P&gt;&lt;DIV&gt;&lt;STRONG&gt;Accessing &lt;A href="https://basemapstyles-api.arcgis.com" target="_blank"&gt;https://basemapstyles-api.arcgis.com&lt;/A&gt; requires authorization. Set a ChallengeHandler to provide credentials. For more information see &lt;A href="https://developers.arcgis.com/net/security-and-authentication/" target="_blank"&gt;https://developers.arcgis.com/net/security-and-authentication/&lt;/A&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;ArcGIS Maps SDK: Load Error: Basemap&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Esri.ArcGISRuntime.Http.ArcGISWebException&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Token Required.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;The required authentication information is missing. Unable to authorize access without a valid token.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;ArcGIS Maps SDK: Load Error: Map&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Esri.ArcGISRuntime.Http.ArcGISWebException&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;Token Required.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;The required authentication information is missing. Unable to authorize access without a valid token.&lt;/STRONG&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Nov 2025 17:15:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1664948#M13774</guid>
      <dc:creator>azlotin</dc:creator>
      <dc:date>2025-11-11T17:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Implementing app authentication with client secret in Runtime SDK 200.7</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1669373#M13798</link>
      <description>&lt;P&gt;Did you set the API Key? You either need to sign into ArcGIS Online first, or set an API key to access the new basemap services. See&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/security-and-authentication/tutorials/implement-api-key-authentication/" target="_blank"&gt;https://developers.arcgis.com/net/security-and-authentication/tutorials/implement-api-key-authentication/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 16:48:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/implementing-app-authentication-with-client-secret/m-p/1669373#M13798</guid>
      <dc:creator>dotMorten_esri</dc:creator>
      <dc:date>2025-12-01T16:48:20Z</dc:date>
    </item>
  </channel>
</rss>

