SimpleSAMLphp Identity Provider Advanced Topics
AJAX iFrame Single Log-Out
If you have read about the AJAX iFrame Single Log-Out approach at Andreas' blog and want to enable it, edit your saml20-idp-hosted.php metadata, and add this configuration line for the IdP:
'logouttype' => 'iframe',
Attribute Release Consent
The attribute release consent is documented in a separate document .
Support for bookmarking the login page
Most SAML software crash fatally when users bookmark the login page and return later on when the cached session information is lost. This is natural as the login page happens in the middle of a SAML transaction, and the SAML software needs some references to the original request in order to be able to produce the SAML Response.
SimpleSAMLphp has implemented a graceful fallback to tackle this situation. When SimpleSAMLphp is not able to lookup a session during the login process, it falls back to the IdP-first flow , described in the next section, where the reference to the request is not needed.
What happens in the IdP-first flow is that a
SAML unsolicited response
is sent directly to the SP. An
is a SAML Response with no reference to a SAML Request (no
When a SimpleSAMLphp IdP falls back to IdP-first flow, the
parameter sent by the SP in the SAML request is also lost. The RelayState information contain a reference key for the SP to lookup where to send the user after successful authentication. The SimpleSAMLphp Service Provider supports configuring a static URL to redirect the user after a unsolicited response is received. See more information about the
parameter in the next section:
If you do not want to start the SSO flow at the SP, you may use the IdP-first setup. To do this, redirect the user to the SSOService endpoint on the IdP with a
parameter that matches the SP EntityID that the user should be authenticated for.
Here is an example of such a URL:
You can also add a
parameter to the IdP-first URL:
parameter is often used to carry the URL the SP should redirect to after authentication. It is also possible to specify the Assertion
Consumer URL with the
For compatibility with certain SPs, SimpleSAMLphp will also accept the
parameters as aliases for
IdP first with SAML 1.1
A SAML 1.1 SP does not send an authentication request to the IdP, but instead triggers IdP initiated authentication directly. If you want to do it manually, you can access the following URL:
The parameters are as follows:
- The entityID of the SP. This parameter is required.
- The AssertionConsumerService endpoint of the SP. This parameter is required.
- The target parameter the SP should receive with the authentication response. This is often the page the user should be sent to after authentication. This parameter is optional for the IdP, but must be specified if the SP you are targeting is running SimpleSAMLphp.
: This parameter must be sent as
target(with lowercase letters) when starting the authentication, while it is sent as
TARGET(with uppercase letters) in the authentication response.
IdP-initiated logout can be initiated by visiting the URL:
https://idp.example.org/simplesaml/saml2/idp/SingleLogoutService.php?ReturnTo=<URL to return to after logout>
It will send a logout request to each SP, and afterwards return the user to the URL specified in the
parameter. Bear in mind that IdPs might disallow redirecting to URLs other than those of their own for security reasons, so in order to get the redirection to work, it might be necessary to ask the IdP to whitelist the URL we are planning to redirect to.