-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to access "ID token"/"claims" in Web Controllers? #147
Comments
Finally someone responded to me over another forum:- var claims = (HttpContext.User as ClaimsPrincipal).Claims;
This is how, it can be done. |
Sad to experince MS team do not care... |
@spalmcc sorry for the delay and if you had the impression we don't care. We do care (but lost people recently ...) |
Hello jmprieur, people who are working to implement B2C Auth are dependent on the documention and support from MS teams. When we are stuck and we dont hear from MS team, we dont know what do you. Someone replied to me from another forum. I posted here so that others can get help. But I am happy now to see respone coming from MS people. We are facing another issue #149 You would know what we are getting null in account. best regards, |
To sum up - to access the id token claims, you can look into the This is available as |
Hello All
We are working on integrating "Azure AD B2C" authentication in MVC 3 based existing application. This is an old application where we are passing logged on "user name" and password for different purposes.
I have integrated "Azure AD B2C" at the moment. To continue with my work, I need to have access to logged in user name in controlers.
What is the limitation?
By default "userName" from Azure AD B2C is not getting populated in the claims due to the limitation mentioned here Azure-Samples/active-directory-b2c-dotnetcore-webapp#64.
How we are overcoming mentioned limitation?
We have added a custome attribute with name "userName" and this value would get populated during account migration.
At the moment, we have populated that attribute using powershell script to continue our work.
How claims is being accessed?
I am able to parse the claims and get access to that custome attribute in claims. Refer the following code
How I can access "Id token"/"claims" in the web controllers?
Is there any way to access id toke or claims in the controllers?
Any pointers would be helpful.
best regards
S
The text was updated successfully, but these errors were encountered: