How to properly create a custom user attribute and assign it to a SAML app

Todd Wolfe 25 Reputation points
2026-03-13T21:06:21.9766667+00:00

I am trying to create a custom attribute in Entra called FederationID. This attribute will be used by a SAML application as the unique identifier for the application. The attribute is formatted as:

<IDStringFromIdP>:user.objectID

I'm looking for the proper steps to take to create the attribute and apply as an app claim for SAML.

Microsoft Security | Microsoft Entra | Microsoft Entra ID

2 answers

Sort by: Most helpful
  1. Todd Wolfe 25 Reputation points
    2026-03-17T22:19:04.5766667+00:00

    I have found the solution. For that particular application it requires specific Name ID formatting that joins the IDP Provider ID and the user.objectID that is sent as the unique identifier. Also, it requires the additional custom attribute FederationID claim with the same formatting along with other typical attributes (email, firstName, lastName, userName) entries.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-03-13T21:06:40.6366667+00:00

    Use two building blocks in Microsoft Entra ID:

    1. A custom attribute in the directory schema (or custom security attribute) to hold FederationID.
    2. A SAML claim mapping on the Enterprise application that emits that attribute as the NameID (or another claim) in the required format.

    Below is the supported path from the provided material.


    1. Create a custom attribute in Entra ID

    If using custom security attributes (recommended for new scenarios):

    1. Sign in to the Microsoft Entra admin center as Attribute Definition Administrator.
    2. Go to Entra IDCustom security attributes.
    3. Either select an existing attribute set or choose Add attribute set to create one (for example, FederationAttributes).
    4. Open the attribute set and select Add attribute.
    5. Configure the attribute:
      • Attribute name: FederationID (no spaces or special characters, max 32 chars).
      • Description: e.g., Federation identifier for SAML apps.
      • Data type: String (since the value is <IDStringFromIdP>:user.objectID).
      • Allow multiple values to be assigned: No (typically a single ID per user).
      • Only allow predefined values to be assigned: No (values will differ per user).
    6. Save the attribute.

    High-level steps are summarized in the “Steps to use custom security attributes” and “Add a custom security attribute definition” sections in the context.

    Next, assign this attribute to users that need it (per your business rules) using the “Assign attributes” step from the overview.

    Note: The context only covers defining and assigning custom security attributes, not concatenating values. If concatenation is required (<IDStringFromIdP>:user.objectID), store the full combined value directly in the FederationID attribute for each user.


    2. Add the attribute as a SAML claim for the app

    Once the attribute exists and is populated on users, configure the SAML app to emit it.

    1. Sign in to the Microsoft Entra admin center as at least Cloud Application Administrator.
    2. Go to Entra IDEnterprise appsAll applications.
    3. Select the SAML application.
    4. Select Single sign-on.
    5. In the User Attributes / Attributes & Claims section, select Edit.

    To add the attribute as a SAML claim:

    1. On the Attributes & Claims page, select Add new claim.
    2. Set Name to FederationID (or whatever the SAML app expects).
    3. For Source, choose the appropriate option for your attribute type:
      • If using a directory schema extension (B2C-style custom attribute), select Directory schema extension, then pick the extension attribute from the b2c-extensions-app as shown in the context.
      • If using a built-in attribute or other mapped attribute, choose Attribute and select the correct source attribute from the drop-down.
    4. Save the claim.

    If the SAML app expects this value as the NameID (User Identifier):

    1. Still under Single sign-on, in User attributes, change the User Identifier to the claim that carries FederationID.
    2. If the app requires a specific NameID format, adjust it per the “Change the NameID format” guidance referenced in the context.

    The context shows similar patterns for SaaS apps (Pega Systems, RStudio Connect) where custom attributes are added and mapped to specific SAML claims or NameID.


    3. Verify attributes are present in the SAML response

    If the app reports that attributes are missing or cannot identify the user:

    1. Confirm the FederationID attribute is populated on the user object.
    2. Confirm the SAML claim mapping exists and is saved on the Enterprise app.
    3. Re-sign in and inspect the SAML response (using the app’s logs or a SAML tracer) to verify that the FederationID claim or NameID is present and in the expected format.

    If the app still cannot identify the user, adjust the User Identifier selection or NameID format as described in the troubleshooting section in the context.


    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.