'Azure easy auth get user role based on AD user Id ASP.net core app WebAPI
I'm following link to make authentication and authorization.
I able to create successfully token based on https://login.microsoftonline.com/{tenantID}/oauth2/token
After that I calling GET API using sayhello. It's everything fine, but I want based on token and UserId/Password of AD user get user role. I search a lot but not getting any concrete solution.
Solution 1:[1]
To decode the Azure Active Directory JWT token using the tool, you can use this online decode tool JSON Web Tokens - jwt.io.
Here is an example covered of how to verify and decode Azure Active Directory Token, refer this article.
If you want to manually decode a bearer token using azure active directory, you can use JwtBearer or AddAzureADBearer middleware to validate the access token.
Please refer this thread which contains code to decode a bearer token.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | DelliganeshS-MT |
