How to get current username and email address to log into C # Azure B2C authentication without Graph API?

How to get current login username and email address? The identity provider for the account is the username, not the email. The username is not returned as a claim in any of the rules such as login, registration, etc. A user attribute of type "SpouseName" can be returned as a login requirement, where I can access through ((ClaimsIdentity)User.Identity).FindFirst("extension_SpouseName").Value This is an MVC application.

+5
source share
1 answer

You need to select custom attributes β€” the email address in your registration profile or the name you use to verify the access token. enter image description here

+2
source

Source: https://habr.com/ru/post/1262607/


All Articles