Azure AD B2C user flow : Is there a way to hide custom attributes on the unified signin/signup page without removing it AND not having to Use custom page content?

John Stephens 16 Reputation points
2022-01-12T15:54:33.21+00:00

I am setting up an Azure AD B2C user flow. I am using the unified sign up or sign in page.
The User attributes:
User Attributes:
Built-in : Given Name, Surname
Custom: InternalUserid

I want to hide the internalUserid on the signup form. We need to keep the internalUserid because it is populated after submitting a signup.

Is there a way to hide the InternalUserId on the signup form without removing it AND not having to Use custom page content?
164373-capture.png

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,871 Reputation points Moderator
    2022-01-12T17:27:58.103+00:00

    Hi @John Stephens • Thank you for reaching out.

    As you don't want to collect InternalUserid during signup and want to populate the value later, you need to:

    1. Uncheck the checkbox for this custom attribute under Azure AD B2C > your_user_flow > User attributes so that users don't get the text box to populate the value for this attribute.
    2. Select the checkbox for InternalUserid attribute under Azure AD B2C > your_user_flow > Application claims so that once the attribute value is populated later, it can be returned as claim in the token.

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

    Below are the optional steps that you can use for verification purposes.

    To confirm if the value of this attribute can be configured after signup, you can use the below graph call using Graph Explorer and sign in with Global Admin of B2C tenant created by using Azure AD > Users > +New user option:

    Call:

    Patch https://graph.microsoft.com/beta/users/object_id_of_signed_up_user  
    

    Body:

    {  
        "extension_2ad62axxxxxxxxxxxxfd85dea302d1b5_InternalUserid": "value_to_be_assigned"  
    }  
    

    Where, 2ad62axxxxxxxxxxxxfd85dea302d1b5 is the application id of Azure AD> App Registrations> b2c-extensions-app (without hyphens).

    Run GET https://graph.microsoft.com/beta/users/object_id_of_signed_up_user to see the value you have assigned to the InternalUserid attribute.

    You can also run your user flow to confirm the value you have assigned to the custom attribute is returned in the token.

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

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


  2. Henry Zhang 206 Reputation points
    2025-01-31T20:17:49.7533333+00:00

    if your API connector is a azure function, you can keep the user attribute unchecked. Instead of return back the custom attribute value, you could make a call to the graph API endpoint and modify the value directly.

    How to call graph API from Azure function here: https://learn.microsoft.com/en-us/azure/app-service/scenario-secure-app-access-microsoft-graph-as-app?tabs=azure-cli

    This way, no need for custom css. But still hide your custom property

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.