How to access OAuth tokens in App Service token store /.auth/me server side?

108 Views Asked by At

I'm trying to access the full detail in the original OAuth token issued by the provider in Azure App Service EasyAuth /.auth/me per the MS docs: https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-oauth-tokens

I'm able to do this client side no problem. Server side I can see the request headers but they do not provide the full detail you get from /.auth/me client side. I'm unable to access /.auth/me server side due to Azure security.

Is there some way to get the same info from /.auth/me server side as you would get client side?

1

There are 1 best solutions below

0
dalchri On

My problem was the security protocol used by System.Net.Http.HttpClient when making the request to /.auth/me.

This line of code solved the problem.

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;