Last post Jul 23, 2018 02:20 AM by Nan Yu
Jul 20, 2018 11:12 AM|pathipati|LINK
I have a Azure AD Barear Token (Access_token and id_token) but i want to validate this in C#. May i know how can i validate this.
Jul 23, 2018 02:20 AM|Nan Yu|LINK
Hi pathipati ,
Please refer to document : https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-token-and-claims#validating-tokens
You can use use the JSON Web Token Handler SDK from the Azure AD team .
Sample code here: https://github.com/Azure-Samples/active-directory-dotnet-webapi-manual-jwt-validation
And if you were using the OWIN components in your project, it is more easy to verify the token. We can use the code below to verify the token:
Audience = ConfigurationManager.AppSettings["ida:Audience"],
Tenant = ConfigurationManager.AppSettings["ida:Tenant"]