The oauth_saml_bearer_grant
feature implements the SAML 2.0 profile for OAuth 2.0 Client Authentication and Authorization Grants.
This feature requires the ruby-saml gem.
It is meant to be used by systems where the OAuth Authorization Server is decoupled from the Identity Provider, and the Identity Provider is a SAML 2.0 Identity Provider.
plugin :rodauth do
enable :oauth_saml_bearer_grant
end
SAML settings are bound to a client application, and stored in its own database table, identified by the oauth_saml_settings_table
auth method (default: :oauth_saml_settings
). They contain the following attributes:
oauth_saml_settings_id_column
:id
The SAML settings primary key.
oauth_saml_settings_oauth_application_id_column
:oauth_application_id
The client application associated with the SAML settings.
oauth_saml_settings_idp_cert_column
:idp_cert
The Identity Provider certificate (in PEM format).
oauth_saml_settings_idp_cert_check_expiration_column
:idp_cert_check_expiration
Whether to check for the aforementioned certificate expiration.
oauth_saml_settings_idp_cert_fingerprint_column
:idp_cert_fingerprint
The Identity Provider certificate fingerprint.
oauth_saml_settings_idp_cert_fingerprint_algorithm_column
:idp_cert_algorithm
The Identity Provider certificate fingerprint algorithm.
oauth_saml_settings_name_identifier_format_column
:name_identifier_format
The name identifier format to extract the user identifier with from the SAML assertion.
oauth_saml_settings_name_identifier_format_column
:name_identifier_format
The SAML name identifier format (when not set the value of the auth method oauth_saml_name_identifier_format
, which is "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
by default).
oauth_saml_settings_issuer_column
:issuer
The SAML assertion issuer.
oauth_saml_settings_audience_column
:audience
The SAML assertion audience (when not set, the OAuth provider token url will be used when validating the assertion).
The token endpoint supports receiving the following arguments:
"grant_type"
can receive "urn:ietf:params:oauth:grant-type:saml2-bearer"
;"assertion"
should receive the SAML assertion;The oauth_saml_bearer_grant
feature can be used for token endpoint client authentication.
when paired with, p.ex. the authorization code grant, it supports these extra parameters:
"client_assertion_type"
can receive "urn:ietf:params:oauth:client-assertion-type:saml2-bearer"
;"client_assertion"
should be the SAML assertion;along with, p.ex. "grant_type=authorization_code&code=eos234..234"