Beta

Beta Instructions

To get access to the beta, please email [email protected]. The SAML2P beta is available until 1st December 2017.

A sample project can be found on GitHub

Nuget Installation

To install the beta nuget package, you must first create a local package source. The best article we've found on how to do this is: https://hassantariqblog.wordpress.com/2016/12/04/asp-net-install-nuget-package-nupkg-file-locally/

Once you have the package source up and running, and your nuget package placed in that directory, the package will be available to install using the namespace IdentityServer4.Saml.

Please note that the SAML2P library is still in beta so, when you go to install the package, look for pre-release versions.

Installation

Including the usual required services for IdentityServer, also include something like the following:

Dependencies

services.AddIdentityServer()
    /* other registrations */
    .AddSamlPlugin()
    .AddInMemoryServiceProviders(new List<ServiceProvider>());

Note: you cannot use the temporary RSA key generated by AddTemporarySigningCredential. This plugin requires a full X509 cert.

Pipeline

app.UseIdentityServer()
    .UseIdentityServerSamlPlugin();

Options

  • SamlEndpoint: base url for SAML2P functionality. Defaults to saml
  • WantAuthenticationRequestsSigned: accepts on signed authentication requests. Default to true
  • DefaultNameIdentifierFormat: defaults to urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified
  • DefaultCanonicalizationMethod: defaults to http://www.w3.org/2001/10/xml-exc-c14n#
  • DefaultDigestAlgorithm: defaults to http://www.w3.org/2001/04/xmlenc#sha256
  • DefaultSignatureAlgorithm: defaults to http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
  • DefaultClaimMapping: dictionary for mapping OIDC claim types to SAML specific assertion types. Defaults:

Dictionary of IdentityServer 4 claim type, SAML2P assertion type.

{ "name", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"},
{ "email", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" },
{ "given_name", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname" },
{ "family_name", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" },
{ "birthdate", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth" },
{ "website", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage" },
{ "gender", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender" },
{ "role", "http://schemas.microsoft.com/ws/2008/06/identity/claims/role" }

Configuring a Service Provider

Client

  • ProtocolType must be set as IdentityServerConstants.ProtocolTypes.Saml2p or “saml2p”
  • RedirectUris must include every url that will issue SAML authentication requests
  • AllowedScopes must still be used. This will dictate what claim types will be returned as SAML assertions

Service Provider

  • EntityId
  • SigningCertificates: public keys for validating requests
  • AssertionConsumerServices: supported bindings & associated urls for serivce provider. This can be found on the Service Providers metadata
  • ClaimsMapping: service provider specific claim mappings. Otherwise default to those found in the SAML options.

Limitations

  • SAML error responses not supported. Errors stay within IdentityServer
  • Only Service Provider initiated authentication requests supported
  • Only the HTTP Redirect binding type supported for authentication requests
  • Only the HTTP POST binding type supported for authentication responses
  • No SAML Logout for beta