sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth PHP Méthode

handleUnsolicitedAuth() public static méthode

This method creates a session from the information received. It will then redirect to the given URL. This is used to handle IdP initiated SSO. This method will never return.
public static handleUnsolicitedAuth ( string $authId, array $state, string $redirectTo )
$authId string The id of the authentication source that received the request.
$state array A state array.
$redirectTo string The URL we should redirect the user to after updating the session. The function will check if the URL is allowed, so there is no need to manually check the URL on beforehand. Please refer to the 'trusted.url.domains' configuration directive for more information about allowing (or disallowing) URLs.
    public static function handleUnsolicitedAuth($authId, array $state, $redirectTo)
    {
        assert('is_string($authId)');
        assert('is_string($redirectTo)');
        $session = SimpleSAML_Session::getSessionFromRequest();
        $session->doLogin($authId, SimpleSAML_Auth_State::getPersistentAuthData($state));
        \SimpleSAML\Utils\HTTP::redirectUntrustedURL($redirectTo);
    }

Usage Example

Exemple #1
0
 /**
  * @deprecated This method will be removed in SSP 2.0. Please use
  * sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth() instead.
  */
 public static function handleUnsolicitedAuth($authId, array $state, $redirectTo)
 {
     sspmod_saml_Auth_Source_SP::handleUnsolicitedAuth($authId, $state, $redirectTo);
 }