PHP Class Aacotroneo\Saml2\Saml2Auth

Show file Open project: aacotroneo/laravel-saml2 Class Usage Examples

Protected Properties

Property Type Description
$auth OneLogin_Saml2_Auth
$samlAssertion

Public Methods

Method Description
__construct ( OneLogin_Saml2_Auth $auth )
acs ( ) Process a Saml response (assertion consumer service) When errors are encountered, it returns an array with proper description
getMetadata ( ) : mixed Show metadata about the local sp. Use this to configure your saml2 IDP
getSaml2User ( ) : Saml2User The user info from the assertion
isAuthenticated ( ) : boolean
login ( $returnTo = null ) Initiate a saml2 login flow. It will redirect! Before calling this, check if user is authenticated (here in saml2). That would be true when the assertion was received this request.
logout ( $returnTo = null, $nameId = null, $sessionIndex = null ) Initiate a saml2 logout flow. It will close session on all other SSO services. You should close local session if applicable.
sls ( $retrieveParametersFromServer = false ) Process a Saml response (assertion consumer service) returns an array with errors if it can not logout

Method Details

__construct() public method

public __construct ( OneLogin_Saml2_Auth $auth )
$auth OneLogin_Saml2_Auth

acs() public method

Process a Saml response (assertion consumer service) When errors are encountered, it returns an array with proper description
public acs ( )

getMetadata() public method

Show metadata about the local sp. Use this to configure your saml2 IDP
public getMetadata ( ) : mixed
return mixed xml string representing metadata

getSaml2User() public method

The user info from the assertion
public getSaml2User ( ) : Saml2User
return Saml2User

isAuthenticated() public method

public isAuthenticated ( ) : boolean
return boolean if a valid user was fetched from the saml assertion this request.

login() public method

Initiate a saml2 login flow. It will redirect! Before calling this, check if user is authenticated (here in saml2). That would be true when the assertion was received this request.
public login ( $returnTo = null )

logout() public method

Initiate a saml2 logout flow. It will close session on all other SSO services. You should close local session if applicable.
public logout ( $returnTo = null, $nameId = null, $sessionIndex = null )

sls() public method

Process a Saml response (assertion consumer service) returns an array with errors if it can not logout
public sls ( $retrieveParametersFromServer = false )

Property Details

$auth protected property

protected OneLogin_Saml2_Auth $auth
return OneLogin_Saml2_Auth

$samlAssertion protected property

protected $samlAssertion