Skip to content

SAML attribute names reference

Common SAML attribute names, from LDAP OIDs and eduPerson to Microsoft claim URIs, with the user property each usually maps to.

Runs in your browser. Nothing you paste is sent to us.

LDAP and X.500 names (urn:oid)

Sent with NameFormat urn:oasis:names:tc:SAML:2.0:attrname-format:uri. The friendly name is the LDAP attribute name.

uid
urn:oid:0.9.2342.19200300.100.1.1Login name. Keycloak user property: username
mail
urn:oid:0.9.2342.19200300.100.1.3Email address. Keycloak user property: email
givenName
urn:oid:2.5.4.42First name. Keycloak user property: firstName
sn
urn:oid:2.5.4.4Last name (surname). Keycloak user property: lastName
cn
urn:oid:2.5.4.3Common name, usually the full name
displayName
urn:oid:2.16.840.1.113730.3.1.241Name to show in the app
telephoneNumber
urn:oid:2.5.4.20Phone number
mobile
urn:oid:0.9.2342.19200300.100.1.41Mobile phone number
title
urn:oid:2.5.4.12Job title
ou
urn:oid:2.5.4.11Organizational unit, such as a department
o
urn:oid:2.5.4.10Organization name
employeeNumber
urn:oid:2.16.840.1.113730.3.1.3Employee number
preferredLanguage
urn:oid:2.16.840.1.113730.3.1.39Preferred language, such as en
memberOf
urn:oid:1.2.840.113556.1.2.102Groups the user belongs to (Active Directory)

eduPerson and research federations

Used across academic federations. Also sent with the uri NameFormat.

eduPersonPrincipalName
urn:oid:1.3.6.1.4.1.5923.1.1.1.6Login name with the organization’s scope: name@scope
eduPersonUniqueId
urn:oid:1.3.6.1.4.1.5923.1.1.1.13Scoped id that is never reassigned
eduPersonAffiliation
urn:oid:1.3.6.1.4.1.5923.1.1.1.1Relation to the organization: student, staff, member…
eduPersonScopedAffiliation
urn:oid:1.3.6.1.4.1.5923.1.1.1.9Affiliation with a scope: staff@scope
eduPersonEntitlement
urn:oid:1.3.6.1.4.1.5923.1.1.1.7Rights to a resource, as URIs
eduPersonTargetedID
urn:oid:1.3.6.1.4.1.5923.1.1.1.10Per-app opaque id (older; pairwise-id replaces it)
schacHomeOrganization
urn:oid:1.3.6.1.4.1.25178.1.2.9Domain of the home organization

Subject identifiers (OASIS)

From the SAML V2.0 Subject Identifier Attributes profile: stable ids sent as attributes instead of the NameID.

subject-id
urn:oasis:names:tc:SAML:attribute:subject-idThe same id for every app, with a scope: id@scope
pairwise-id
urn:oasis:names:tc:SAML:attribute:pairwise-idA different id for each app, scoped

Microsoft Entra ID and AD FS claims

Claim type URIs used as attribute names by Microsoft identity providers and the apps built for them.

emailaddress
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddressEmail address. Keycloak user property: email
givenname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givennameFirst name. Keycloak user property: firstName
surname
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surnameLast name. Keycloak user property: lastName
name
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameUser name; Entra ID sends the user principal name here. Keycloak user property: username
upn
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upnUser principal name: name@domain
nameidentifier
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifierThe user’s id, often the same as the NameID
displayname
http://schemas.microsoft.com/identity/claims/displaynameName to show in the app
objectidentifier
http://schemas.microsoft.com/identity/claims/objectidentifierEntra ID object id of the user
tenantid
http://schemas.microsoft.com/identity/claims/tenantidEntra ID tenant id
groups
http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsGroup ids or names
role
http://schemas.microsoft.com/ws/2008/06/identity/claims/roleApp roles

How to use it

  1. Search by the friendly name, the URI or what the attribute holds.
  2. Copy the full name for a mapper or the app’s settings.
  3. Send it with the NameFormat the app expects, usually uri for these names.

What to know

An attribute has a Name, an optional FriendlyName and a NameFormat. Apps match on Name, so the exact string matters: urn:oid:0.9.2342.19200300.100.1.3 and mail are different attributes to them.

In a Keycloak SAML client, mappers decide which attributes the assertion carries. A User Property or User Attribute mapper sets the SAML Attribute Name, the Friendly Name and the SAML Attribute NameFormat (Basic, URI Reference or Unspecified).

When Keycloak signs users in through another SAML identity provider, an Attribute Importer mapper on that identity provider reads an attribute by name or friendly name into a user property such as email, firstName or lastName.

What SAML attributes are

The NameID says who the user is. Attributes say more about them: name, email, department, groups, roles. They travel in the assertion’s saml:AttributeStatement, each as a saml:Attribute with one or more saml:AttributeValue children.

Apps use attributes to fill in the user’s profile, decide permissions and create accounts on first sign-in. Most SAML integration work after the first successful sign-in is about getting the right attributes, with the right names, to the app.

How an attribute is written

Attributes in an assertion (sample)
<saml:AttributeStatement>
  <saml:Attribute Name="urn:oid:2.5.4.42" FriendlyName="givenName"
      NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
    <saml:AttributeValue>Alice</saml:AttributeValue>
  </saml:Attribute>
  <saml:Attribute Name="Role"
      NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic">
    <saml:AttributeValue>user</saml:AttributeValue>
    <saml:AttributeValue>billing-viewer</saml:AttributeValue>
  </saml:Attribute>
</saml:AttributeStatement>

Name

The identifier apps match on. It is compared as an exact string. mail, email and urn:oid:0.9.2342.19200300.100.1.3 are three different attributes to an app, even though people mean the same thing.

FriendlyName

An optional, human-readable label. SAML core treats it as a convenience for people, not as part of the attribute’s identity, but some apps and some identity providers match on it anyway.

NameFormat

How to read the name. The three standard values are urn:oasis:names:tc:SAML:2.0:attrname-format:basic for simple names, …:uri for names that are URIs, and …:unspecified. Some apps check it along with the name.

Values

An attribute can have several values, such as one per group. Apps differ in whether they expect several AttributeValue elements or one value with a separator. Several elements is the standard way.

The naming families you will meet

LDAP and X.500 OIDs

Directory attributes have numeric object identifiers. SAML profiles for LDAP write them as urn:oid: plus the OID, with the uri name format and the LDAP name as the friendly name. For example urn:oid:2.5.4.42 is givenName and urn:oid:0.9.2342.19200300.100.1.3 is mail.

eduPerson and research federations

Academic federations use the eduPerson schema in the same urn:oid: form, for example eduPersonPrincipalName and eduPersonScopedAffiliation. Values that carry a scope look like name@scope, where the scope is the home organization’s domain.

OASIS subject identifiers

The SAML V2.0 Subject Identifier Attributes profile defines urn:oasis:names:tc:SAML:attribute:subject-id, the same id for every app, and urn:oasis:names:tc:SAML:attribute:pairwise-id, a different id per app. Both are scoped. They are meant to replace older approaches such as eduPersonTargetedID.

Microsoft claim URIs

Microsoft Entra ID and AD FS name attributes with claim type URIs such as http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress. Apps built for those identity providers often expect these names, even when another identity provider sends the assertion.

Plain names

Many apps simply document names such as email, firstName or groups with the basic format. When an app documents its names, use exactly those.

What this reference does

The tool above lists common attributes in each family with their full name, what they hold, and the Keycloak user property they map to where there is a direct one. Filter by friendly name, OID, claim URI or meaning, and copy a name with one click.

The list is not exhaustive. It covers the names that come up most when connecting apps and identity providers. Check the app’s documentation for anything it lists.

Sending attributes from Keycloak

In Keycloak, a SAML client’s attributes come from protocol mappers, set on the client or on client scopes assigned to it. For each attribute the app needs, add a mapper and set three fields: SAML Attribute Name, Friendly Name and SAML Attribute NameFormat, which is Basic, URI Reference or Unspecified.

Mapper typeSends
User PropertyA built-in user field such as username, email, firstName or lastName
User AttributeA custom user attribute you defined
Role listThe user’s roles, by default as an attribute named Role
Group listThe user’s groups
Hardcoded attributeThe same value for every user
  1. Open the client, then its client scopes, then the dedicated scope for the client.
  2. Add a mapper by configuration and pick the type.
  3. Set the SAML attribute name to exactly what the app expects, the friendly name if the app wants one, and the name format.
  4. Sign in and read the assertion with the SAML response decoder to confirm.

Receiving attributes in Keycloak

When Keycloak brokers sign-in through another SAML identity provider, mappers on that identity provider decide what to keep. An Attribute Importer mapper reads an attribute, by its name or its friendly name, into a user property such as email, firstName or lastName, or into a user attribute. Without importers, Keycloak still creates the user, but profile fields may be empty and the first broker login flow may ask the user to fill them in.

Use cases

Connecting a SaaS app

SaaS apps usually publish the exact attribute names they read. Copy them from the app’s SAML setup page into Keycloak mappers, one by one, and match the name format they show.

Accepting a customer’s Entra ID or AD FS

When a customer signs in through their Microsoft identity provider, expect claim URIs. Map emailaddress, givenname and surname to Keycloak’s email, first name and last name with Attribute Importer mappers.

Joining a research federation

Federations expect the urn:oid: names with the uri format, and often scoped values. Set both the OID name and the friendly name, because some members match on one and some on the other.

Common problems

  • The attribute arrives but the app ignores it: the name or name format differs from what the app expects, often by case.
  • Groups arrive as one value with commas when the app expects one value per group, or the other way around.
  • Roles are missing: the client’s scope does not include them, for example because Full scope allowed is off and the roles were not added to the client’s scope.
  • Email is empty: the user has no email in the directory, or the importer reads the wrong attribute name.
  • The app shows a URI as the user’s name: it reads the attribute Name where it should read the value, or the mapping is reversed.

Privacy

Send each app only the attributes it needs. Every extra attribute is personal data the app stores and must protect. In Keycloak, keep client scopes small and avoid adding broad mappers to every client by default.

Multi-valued attributes

Groups, roles and entitlements usually have several values. The standard way is one saml:AttributeValue element per value, all inside one saml:Attribute. Some apps instead expect one value with a separator, such as a comma, and some expect the same attribute repeated. Check the app’s documentation and its sample assertion.

In Keycloak, the Role list and Group list mappers send one value per role or group. The Role list mapper has a Single Role Attribute option; when on, all roles go in one attribute with one value element each, and when off, each role gets its own attribute element. Decode a real assertion to see which shape you are sending.

Naming attributes for your own app

If you are writing the app, you choose the names. A few rules keep integrations easy:

  • Accept the common URI names (the urn:oid: forms and the Microsoft claim URIs) as well as short names, so customers can connect most identity providers without custom mapping.
  • Let administrators map names in your app’s SAML settings rather than hard-coding one set.
  • Match on Name, not FriendlyName.
  • Do not rely on email for identity; use the NameID or a stable id attribute.
  • Publish a sample assertion in your documentation that shows every attribute you read.
Questions

Frequently asked questions

What is the SAML attribute name for email?

With LDAP-style names it is urn:oid:0.9.2342.19200300.100.1.3, friendly name mail. Microsoft identity providers use http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress. Many apps simply use email; check what the app expects.

What is the OID for givenName and surname?

givenName is urn:oid:2.5.4.42 and sn, the surname, is urn:oid:2.5.4.4.

What is the difference between Name and FriendlyName?

Name is the identifier apps match on. FriendlyName is an optional label for people. Do not rely on it for matching unless the app asks you to.

What does the SAML attribute NameFormat mean?

It says how to read the Name: basic for a simple string, uri for a URI such as an urn:oid name, or unspecified. Some apps check it along with the name.

How do I add an attribute to a Keycloak SAML assertion?

Add a protocol mapper to the client’s dedicated scope, for example User Property or User Attribute, and set its SAML Attribute Name, Friendly Name and NameFormat.

How do I send groups or roles in SAML from Keycloak?

Use the Group list mapper for groups and the Role list mapper for roles. Check whether the app wants one value per group or role, and the exact attribute name it reads.

How do I map SAML attributes from an external identity provider in Keycloak?

Add an Attribute Importer mapper on the identity provider. Give the attribute name or friendly name and the Keycloak user property or attribute to store it in.

How do I send several values in one SAML attribute?

Put one AttributeValue element per value inside the same Attribute element. Some apps expect a single separated value instead, so check what the app reads.

Which attribute names does Microsoft Entra ID send?

By default, claim type URIs such as http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress, givenname, surname and name. Administrators can change and add claims per app.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.