We are using Azure AD for authentication in our application that consists of a Angular 7 client consuming an ASP.NET Core 2.2 Web API.
We are able to authenticate the user successfully from Angular using Azure AD, and the obtained JWT token is being used and validated on the Web API. However, we want to control authorization from our Web API. Is there a way to append claims to the token
on the API side once it's generated by Azure AD?
Is there a way to append claims to the token on the API side once it's generated by Azure AD?
The token is issued by AAD to access your web api , why do you mean by "on the API side" , do you want to modify the token after sending token to web api ?
Yes, once the token is issued by Azure AD, I would like to be able to Add extra claims that come from the applications database. I'm starting to realize that this might not be possible.
Member
1 Points
4 Posts
ASP.NET Core 2.2 Web API. Add claims to Azure AD Token
Jun 21, 2019 10:14 AM|JFercan|LINK
Hello,
We are using Azure AD for authentication in our application that consists of a Angular 7 client consuming an ASP.NET Core 2.2 Web API.
We are able to authenticate the user successfully from Angular using Azure AD, and the obtained JWT token is being used and validated on the Web API. However, we want to control authorization from our Web API. Is there a way to append claims to the token on the API side once it's generated by Azure AD?
Thank you,
Participant
860 Points
498 Posts
Re: ASP.NET Core 2.2 Web API. Add claims to Azure AD Token
Jun 21, 2019 10:33 AM|AddWeb Solution|LINK
Hello JFercan,
Kindly refer this below links, I hope these will help you
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-optional-claims
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-claims-mapping
https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-claims-mapping#claims-mapping-policy-assignment
https://aadguide.azurewebsites.net/claims/
Thank you.
All-Star
18815 Points
3831 Posts
Re: ASP.NET Core 2.2 Web API. Add claims to Azure AD Token
Jun 24, 2019 01:59 AM|Nan Yu|LINK
Hi JFercan ,
The token is issued by AAD to access your web api , why do you mean by "on the API side" , do you want to modify the token after sending token to web api ?
Best Regards,
Nan Yu
Member
1 Points
4 Posts
Re: ASP.NET Core 2.2 Web API. Add claims to Azure AD Token
Jun 26, 2019 09:07 AM|JFercan|LINK
Hello Nan,
Yes, once the token is issued by Azure AD, I would like to be able to Add extra claims that come from the applications database. I'm starting to realize that this might not be possible.
Thank you
All-Star
18815 Points
3831 Posts
Re: ASP.NET Core 2.2 Web API. Add claims to Azure AD Token
Jun 27, 2019 01:50 AM|Nan Yu|LINK
HI JFercan ,
Yes , you should not do that .
Best Regards,
Nan Yu