samly v0.10.1 Samly.State.Store behaviour View Source

Specification for Samly state stores.

Link to this section Summary

Types

The name_id should not be used independent of the idp_id. It is within the scope of idp_id. Together these form the assertion key

IdP identifier associated with the assertion

SAML nameid returned by IdP

Options passed during the store initialization

Callbacks

Removes the given SAML assertion from the store

Returns a Samly assertion if present in the store

Initializes the store

Saves the given SAML assertion in the store

Link to this section Types

Link to this type assertion_key() View Source
assertion_key() :: {idp_id(), name_id()}

The name_id should not be used independent of the idp_id. It is within the scope of idp_id. Together these form the assertion key.

IdP identifier associated with the assertion.

SAML nameid returned by IdP.

Options passed during the store initialization.

Link to this section Callbacks

Link to this callback delete_assertion(arg0, assertion_key, opts) View Source
delete_assertion(Plug.Conn.t(), assertion_key(), opts()) ::
  Plug.Conn.t() | no_return()

Removes the given SAML assertion from the store.

May raise an error if there is a failure. An authenticated session must be terminated after calling this.

Link to this callback get_assertion(arg0, assertion_key, opts) View Source
get_assertion(Plug.Conn.t(), assertion_key(), opts()) ::
  Samly.Assertion.t() | nil

Returns a Samly assertion if present in the store.

Returns nil if the assertion for the given key is not present in the store.

Initializes the store.

The options returned from this function will be given to get_assertion/3, put_assertion/4 and delete_assertion/3.

Link to this callback put_assertion(arg0, assertion_key, arg2, opts) View Source

Saves the given SAML assertion in the store.

May raise an error if there is a failure. An authenticated session should not be established in that case.