How to use Microsoft Graph API to update the visibiliy of custom user attribute in a user flow?

Lucas Pires Savassa 20 Reputation points
2026-02-26T00:06:18.7866667+00:00

I have created a custom user attribute that represents the quantity of virtual currency that the user has.

This attribute is not supposed to appear during sign-up, but I'd like to manipulate it programmatically and include it in the ID token.

I read the documentation and had the idea to hide this custom attribute, by setting its visibility to false. But I don't know how to do that. The document explains that I should use the Graph API, but it doesn't provide the steps to do so.

I've never used the Graph API. How can I accomplish this?

Appreciate any feedback

Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Oldest
  1. AI answer

    2026-02-26T00:06:31.8533333+00:00

    To keep the custom attribute off the sign-up page but still set it programmatically and have it available on the user object (and then in tokens), configure its hidden and editable flags via Microsoft Graph.

    For external sign-up user flows, the attribute visibility is controlled by the authenticationAttributeCollectionInputConfiguration resource. The key flags are:

    • hidden: false by default (attribute is shown on the sign-up page). Set to true to hide it.
    • editable: true by default (user can edit it). Set to true or false depending on whether it should be user-editable if/when shown.

    To achieve the scenario “not visible on sign-up, but set programmatically”:

    • Set hidden = true
    • Set editable = true

    This hides the attribute from the page while still allowing it to be set via Graph or a custom extension.

    High-level steps using Microsoft Graph:

    1. Ensure the custom attribute is created in Microsoft Entra External ID and added to the user flow so it exists as an attribute in that flow.
    2. Use Microsoft Graph to update the user flow’s page layout configuration and set the flags for that attribute via the authenticationAttributeCollectionInputConfiguration resource.
      • The documentation calls out this resource and points to an example on “updating the page layout of a self-service sign up user flow” that shows how to set hidden and editable for each attribute.
    3. After the attribute is hidden and still editable programmatically, use Microsoft Graph to set its value on the user object (for example, via extension attributes as described for External ID) and configure the user flow/claims mapping so that this attribute is emitted in the ID token.

    The key behavior from the documentation:

    • To hide the attribute but still allow programmatic setting:
      • hidden = true
      • editable = true
    • This is configured using the authenticationAttributeCollectionInputConfiguration resource on the user flow via Microsoft Graph.

    Once configured, the attribute will not appear during sign-up, but applications can set it through Graph and then include it in tokens via the user flow’s claims configuration.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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