Class SamlAssertionStore

java.lang.Object
org.mockserver.saml.SamlAssertionStore

public class SamlAssertionStore extends Object
In-memory state backing the mock SAML SSO flow.

Holds one SamlAssertionStore.Provider per generated mock IdP, keyed by the ssoServiceUrl it serves. The /saml/sso class callback (SamlSsoCallback) looks up its provider by the request path to build, sign, and POST a SAML Response back to the SP's assertion consumer service.

This is a process-wide singleton (mirroring OidcAuthorizationStore and the other in-memory registries) because the SSO class callback is instantiated fresh per request and therefore cannot share instance state.

  • Method Details

    • getInstance

      public static SamlAssertionStore getInstance()
    • registerProvider

      public void registerProvider(SamlAssertionStore.Provider provider)
      Registers (or replaces) the provider serving the given SSO path. The most recently registered provider for a path wins, so re-running PUT /mockserver/saml with the same SSO path refreshes the signing credential and attributes.
    • providerForSsoPath

      public SamlAssertionStore.Provider providerForSsoPath(String ssoServiceUrl)
      Finds the provider serving the given SSO path, or null if none registered.
    • providerForSloPath

      public SamlAssertionStore.Provider providerForSloPath(String sloServiceUrl)
      Finds the provider serving the given Single-Logout (SLO) path, or null if none registered (or the provider has no SLO endpoint configured).
    • reset

      public void reset()