Click here to Skip to main content
15,896,201 members

Comments by Member 10014841 (Top 3 by date)

Member 10014841 19-Jul-20 10:16am View    
Thank you so much for your advice. At least I could send the request properly with your guidance. Please somebody help me on the unsolved issue..
Member 10014841 19-Jul-20 5:49am View    
Sorry about typo error. I meant WebClient instance was used(client).

client.DownloadData(userInfoUri)

Unauthorized 401 error still happens.
Member 10014841 19-Jul-20 5:26am View    
I requested as per mentioned modification. But still unauthorized(401) error occurs.

//accessToken variable contains access token data
string userInfoURL = "https://[base-server-url]/userinfo;
Uri userInfoUri = new Uri(userInfoURL);
WebClient client = new WebClient();
client.Headers.Add(HttpRequestHeader.Authorization,"Bearer " + accessToken);
byte[] userInfoBytes = webClient.DownloadData(userInfoUri);
string response = Encoding.UTF8.GetString(userInfoBytes);