Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get current login user's username & email address in C# Azure B2C authentication without Graph API?

How to get current login username and also their email address? Identity provider for the account is username not email. Username is not returned as claims in any of policy such as sign-in, sign-up etc. Custom attribute like "SpouseName" can be returned as claim for sign in where I can access by ((ClaimsIdentity)User.Identity).FindFirst("extension_SpouseName").Value It's an MVC application.

like image 993
P. Nabin Avatar asked Jan 10 '17 20:01

P. Nabin


Video Answer


1 Answers

You need to select the user attributes - email address in your signup or signin profile which you are using to validate the access token.enter image description here

like image 76
Karthikeyan VK Avatar answered Oct 02 '22 19:10

Karthikeyan VK