Table of Contents

Class SamlSingleSignOnEndpoint

Namespace
Fdyay.IdentityServer.Saml.Endpoints
Assembly
Fdyay.IdentityServer.Saml.dll

The SAML 2.0 IdP single sign-on endpoint (SP-initiated, HTTP-Redirect and HTTP-POST).

public sealed class SamlSingleSignOnEndpoint : IEndpointHandler
Inheritance
SamlSingleSignOnEndpoint
Implements
Inherited Members

Remarks

Sign-on is browser-facing, so a failure is shown to a person rather than returned as a bare status code: the detail is written to the shared ErrorMessage store and the browser is sent to UserInteraction.ErrorUrl with the opaque id, exactly as the OIDC authorize endpoint does.

Constructors

SamlSingleSignOnEndpoint(IAuthnRequestValidator, ISaml2SsoResponseGenerator, ISaml2SsoInteractionResponseGenerator, IOptions<SamlOptions>, IOptions<IdentityServerOptions>, IIssuerNameService, IMessageStore<ErrorMessage>, ISamlSigninStateStore, IHandleGenerationService, IEventService, IUserSession, TimeProvider, IProfileService)

Answers through responseGenerator and decides what the user is asked through interactionGenerator, the host's ISaml2SsoInteractionResponseGenerator. Since 0.163.0.

public SamlSingleSignOnEndpoint(IAuthnRequestValidator requestValidator, ISaml2SsoResponseGenerator responseGenerator, ISaml2SsoInteractionResponseGenerator interactionGenerator, IOptions<SamlOptions> samlOptions, IOptions<IdentityServerOptions> options, IIssuerNameService issuerNameService, IMessageStore<ErrorMessage> errorMessages, ISamlSigninStateStore signInStates, IHandleGenerationService handles, IEventService events, IUserSession userSession, TimeProvider time, IProfileService profile)

Parameters

requestValidator IAuthnRequestValidator
responseGenerator ISaml2SsoResponseGenerator
interactionGenerator ISaml2SsoInteractionResponseGenerator
samlOptions IOptions<SamlOptions>
options IOptions<IdentityServerOptions>
issuerNameService IIssuerNameService
errorMessages IMessageStore<ErrorMessage>
signInStates ISamlSigninStateStore
handles IHandleGenerationService
events IEventService
userSession IUserSession
time TimeProvider
profile IProfileService

Remarks

profile is what the callback asks whether the user who came back is still active.

SamlSingleSignOnEndpoint(IAuthnRequestValidator, ISaml2SsoResponseGenerator, IOptions<SamlOptions>, IOptions<IdentityServerOptions>, IIssuerNameService, IMessageStore<ErrorMessage>, ISamlSigninStateStore, IHandleGenerationService, IEventService, IUserSession, TimeProvider, IProfileService)

The 0.152.0 constructor, kept: it answers through responseGenerator and decides what the user is asked through the default Saml2SsoInteractionResponseGenerator over profile.

public SamlSingleSignOnEndpoint(IAuthnRequestValidator requestValidator, ISaml2SsoResponseGenerator responseGenerator, IOptions<SamlOptions> samlOptions, IOptions<IdentityServerOptions> options, IIssuerNameService issuerNameService, IMessageStore<ErrorMessage> errorMessages, ISamlSigninStateStore signInStates, IHandleGenerationService handles, IEventService events, IUserSession userSession, TimeProvider time, IProfileService profile)

Parameters

requestValidator IAuthnRequestValidator
responseGenerator ISaml2SsoResponseGenerator
samlOptions IOptions<SamlOptions>
options IOptions<IdentityServerOptions>
issuerNameService IIssuerNameService
errorMessages IMessageStore<ErrorMessage>
signInStates ISamlSigninStateStore
handles IHandleGenerationService
events IEventService
userSession IUserSession
time TimeProvider
profile IProfileService

SamlSingleSignOnEndpoint(IAuthnRequestValidator, SamlResponseGenerator, IOptions<SamlOptions>, IOptions<IdentityServerOptions>, IIssuerNameService, IMessageStore<ErrorMessage>, ISamlSigninStateStore, IHandleGenerationService, IEventService, IUserSession, TimeProvider, IProfileService?, ISamlNameIdGenerator?)

The 0.151.0 constructor, kept: it answers through Saml2SSoResponseGenerator's steps over responseGenerator.

public SamlSingleSignOnEndpoint(IAuthnRequestValidator requestValidator, SamlResponseGenerator responseGenerator, IOptions<SamlOptions> samlOptions, IOptions<IdentityServerOptions> options, IIssuerNameService issuerNameService, IMessageStore<ErrorMessage> errorMessages, ISamlSigninStateStore signInStates, IHandleGenerationService handles, IEventService events, IUserSession userSession, TimeProvider time, IProfileService? profile = null, ISamlNameIdGenerator? nameIds = null)

Parameters

requestValidator IAuthnRequestValidator
responseGenerator SamlResponseGenerator
samlOptions IOptions<SamlOptions>
options IOptions<IdentityServerOptions>
issuerNameService IIssuerNameService
errorMessages IMessageStore<ErrorMessage>
signInStates ISamlSigninStateStore
handles IHandleGenerationService
events IEventService
userSession IUserSession
time TimeProvider
profile IProfileService
nameIds ISamlNameIdGenerator

Methods

ProcessAsync(HttpContext)

Processes the request, or returns null to pass the request through.

public Task<IEndpointResult?> ProcessAsync(HttpContext context)

Parameters

context HttpContext

Returns

Task<IEndpointResult>

Remarks

Served at two paths. At SingleSignOnServicePath it answers an arriving AuthnRequest, and passes a binding SingleSignOnServiceBindings does not list through with null; at SingleSignOnCallbackPath it resumes the sign-in the login page returned to, and a reference that resolves nothing goes to the error page.