Skip to content

SAML Constants and Status Codes

Duende.IdentityServer.Saml.Models.SamlStatusCodes

Section titled “Duende.IdentityServer.Saml.Models.SamlStatusCodes”

Well-known SAML 2.0 status code URNs as defined in the SAML 2.0 Core specification. Use them in error responses, such as Saml2InteractionResponse.Error, NameIdGenerationResult.Failure, and AuthnRequestValidationResult.InValid.

ConstantValueKindDescription
Successurn:oasis:names:tc:SAML:2.0:status:SuccessTop-levelThe request succeeded.
Requesterurn:oasis:names:tc:SAML:2.0:status:RequesterTop-levelThe request could not be performed due to an error on the part of the requester.
Responderurn:oasis:names:tc:SAML:2.0:status:ResponderTop-levelThe request could not be performed due to an error on the part of the SAML responder or SAML authority.
VersionMismatchurn:oasis:names:tc:SAML:2.0:status:VersionMismatchTop-levelThe SAML responder could not process the request because the version of the request message was incorrect.
NoAuthnContexturn:oasis:names:tc:SAML:2.0:status:NoAuthnContextSecond-levelThe specified authentication context requirements cannot be met by the responder.
AuthnFailedurn:oasis:names:tc:SAML:2.0:status:AuthnFailedSecond-levelThe authentication attempt failed.
InvalidNameIdPolicyurn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicySecond-levelThe responding provider cannot or will not support the requested name identifier policy.
RequestDeniedurn:oasis:names:tc:SAML:2.0:status:RequestDeniedSecond-levelThe SAML responder or SAML authority is able to process the request but has chosen not to respond.
UnknownPrincipalurn:oasis:names:tc:SAML:2.0:status:UnknownPrincipalSecond-levelThe responding provider does not recognize the principal specified or implied by the request.
UnsupportedBindingurn:oasis:names:tc:SAML:2.0:status:UnsupportedBindingSecond-levelThe SAML responder cannot properly fulfill the request using the protocol binding specified in the request.
NoPassiveurn:oasis:names:tc:SAML:2.0:status:NoPassiveSecond-levelThe identity provider cannot authenticate the presenter in a manner that satisfies the IsPassive constraint of the request.
PartialLogouturn:oasis:names:tc:SAML:2.0:status:PartialLogoutSecond-levelUsed with a top-level status code of Success to indicate that not all requested logouts were successful.

Constants for SAML 2.0 values, such as URNs, namespaces, binding names, and default endpoint paths. Groups of constants:

GroupMembers
NameIdentifierFormatsNameID format URNs: EmailAddress (email address format), Persistent (persistent format), Transient (transient format), Unspecified (unspecified format)
BindingsSAML protocol binding URNs: HttpRedirect (urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect, the HTTP-Redirect binding), HttpPost (urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST, the HTTP-POST binding)
AuthnContextClassesAuthentication context class URNs: PasswordProtectedTransport (password protected transport), Unspecified (unspecified)
ClaimTypesClaim types that carry SAML-specific information: AuthnContextClassRef (saml:acr, the authentication context class reference of the authentication)
ContentTypesMetadata (application/samlmetadata+xml, the media type of SAML metadata documents, see the IANA registration)
DefaultsDefault values. These are the default endpoint paths: Saml2Path, SingleSignOnServicePath, SingleSignOnCallbackPath, SingleLogoutServicePath, SingleLogoutCallbackPath, SpLogoutCompletionPath

The Defaults constants:

ConstantValueDescription
Saml2Path/Saml2Default path for SAML2
SingleSignOnServicePath/Saml2/SSODefault path for SSO endpoint
SingleSignOnCallbackPath/Saml2/SSO/CallbackDefault path for SSO callback endpoint (post-login return)
SingleLogoutServicePath/Saml2/SLODefault path for SLO endpoint
SingleLogoutCallbackPath/Saml2/SLO/CallbackDefault path for SLO callback endpoint (post-logout return)
SpLogoutCompletionPath/saml/slo/sp-completeDefault path for SP-side logout completion endpoint
var sp = new SamlServiceProvider
{
DefaultNameIdFormat = SamlConstants.NameIdentifierFormats.EmailAddress
};