Getting Token (generateTorken) in C# from Windows Authenticated Enterprise

647
1
Jump to solution
12-28-2020 08:50 AM
JoeHershman
MVP Regular Contributor

I am having an issue outlined here:

https://community.esri.com/t5/arcgis-rest-api-questions/getting-token-generatetorken-in-c-from-windo...

This is really associated to using rest from C#, but thought maybe someone here has had a similar experience.  Plus I figure the Runtime API has to be doing something similar and things work from Runtime

Thoughts?

Thanks,
-Joe
0 Kudos
1 Solution

Accepted Solutions
JoeHershman
MVP Regular Contributor

For anyone interested

Would seem you need to tell the HttpClient to use DefaultCredentials

 

using HttpClient httpClient = new HttpClient(new HttpClientHandler{UseDefaultCredentials = true});

 

Took some looking at decompiled Runtime code to find that

Thanks,
-Joe

View solution in original post

0 Kudos
1 Reply
JoeHershman
MVP Regular Contributor

For anyone interested

Would seem you need to tell the HttpClient to use DefaultCredentials

 

using HttpClient httpClient = new HttpClient(new HttpClientHandler{UseDefaultCredentials = true});

 

Took some looking at decompiled Runtime code to find that

Thanks,
-Joe
0 Kudos