NameID formats and AttributeStatements
What breaks more often than login success is 'who was I logged in as'. In SAML the Subject/NameID is the user identifier and AttributeStatement holds the user's attributes. Both have format and naming rules, so the values alone can mislead.
NameID formats
| Format | Meaning | Caveat |
|---|---|---|
| persistent | an opaque identifier fixed per SP | cannot compare users; the value may change on reissue |
| transient | an identifier that changes per session | unusable after logout; poor for account mapping |
| emailAddress | the e-mail address | can change or repeat; exposes personal data |
| unspecified | the IdP's default format | the real format must be checked separately |
| entity | an entity identifier | used between services |
Many IdPs use persistent to prevent correlation between SPs, so the same user can have a different NameID at each SP. Keep that in mind when comparing values in logs.
The three names of an attribute
Name: the real attribute name, often a URI (for exampleurn:oid:2.5.4.42orhttp://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress).NameFormat: which scheme the name follows — URI, basic, unspecified.FriendlyName: a human alias that may be absent.
An SP usually finds attributes through a mapping configuration rather than the Name alone. The same Name with a different NameFormat can fail to map.
Multi-valued attributes
One Attribute can carry several AttributeValue elements; group and role lists are typical. If the SP only reads the first value, the second looks as if it vanished. Compare the count and order of values.
Common attribute names
| Purpose | Common Name |
|---|---|
| urn:oid:0.9.2342.19200300.100.1.3 / emailaddress | |
| name | urn:oid:2.5.4.42 (givenName), 2.5.4.4 (sn) |
| department | urn:oid:2.16.840.1.113719.1.1.4.1.25 |
| group | http://schemas.xmlsoap.org/claims/Group |
| role | http://schemas.microsoft.com/ws/2008/06/identity/claims/role |
samlview lists every AttributeStatement attribute with name, NameFormat, FriendlyName and values, one line per value. Sensitive values can be masked in the XML view before sharing.
Frequently asked questions
The NameID changes every time. Is that a bug?
With the transient format it is normal: a new value is issued per session. Account mapping uses persistent or emailAddress instead.
An attribute is missing. Why?
The IdP's release policy may not send it to this SP. Check whether the AttributeStatement is empty or whether only the name differs.
How do I share without personal data?
Turn on masking in the XML view; NameID, attribute values and SessionIndex are hidden while structure and names remain, which is enough for analysis.
Load the multi-attribute sample and see how the values are laid out.
Open the toolThis article follows OASIS SAML 2.0 Core (2005), SAML 2.0 Bindings, SAML 2.0 Profiles, XML Signature 1.1 and RFC 1951 (DEFLATE). Every example is synthetic data.