In Azure B2C Custom attributes is not passed with user claims

Mina Mounir 1 Reputation point
2020-03-22T18:12:20.683+00:00

Hello,

I have created a signin/signup user flow in Azure B2C. I have created some custom attributes. when my custom Mobile application login, the token does not contain the custom attributes I created.
all my attributes are checked in the Application Claims.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,633 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,301 Reputation points
    2020-03-23T05:39:44.657+00:00

    @Mina Mounir Did you select the attribute under User Attribute section as well? When you signed up for a user account, did you specify a value for the custom attribute? If the attribute doesn't have a value specified, it will not be returned in the token. In that case, you should consider using a profile update policy to update the value of that attribute first. Or sign-up with a new user account for testing purpose and make sure you specify a value for the attribute and check the token that you get after subsequent sign-in for that user.

    -----------------------------------------------------------------------------------------------------------

    Please "Accept as answer" wherever the information provided helps you to help others in the community.


  2. AmanpreetSingh-MSFT 56,301 Reputation points
    2020-03-24T10:57:14.21+00:00

    @Mina Mounir , You need to include this attribute in your Signup flow so that users can specify a value for this attribute when they sign-up. For existing users, you can include this attribute in the Profile Update policy, so that they can specify this attribute even after signup.
    You can also login using your Global Admin account to https://developer.microsoft.com/en-us/graph/graph-explorer by clicking on Sign in with Microsoft button in the left pane and make below call to update the value of the extension attribute:

    Call: PATCH https://graph.microsoft.com/beta/users/user's_object_id

    Body: {"extension_2adxxxxxxxxxxxxxxxxxxxd1b5_ShoeSize": 11}

    In this example, custom attribute is ShoeSize and the Value is 11.

    5671-capture.jpg

    -----------------------------------------------------------------------------------------------------------

    Please "Accept as answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

  3. bhasker s 6 Reputation points
    2020-05-06T08:51:23.74+00:00

    @AmanpreetSingh-MSFT

    How to Add Custom attribute to user object while creating/updating using Microsoft.Graph SDK(Not with REST API)?

    Every where i am finding sample with Graph REST API not with Graph SDK.

    i am using as serviceClient.Users().Request.AddAsync(userObject) tried adding to additionaldata but it dint work out.

    7963-exr4s7duyaaj4te.jpg

    https://twitter.com/bhasker412/status/1257678665883648001?s=20

    0 comments No comments