Facade
In addition to the methods already mentioned, the SAML facade provides access to the following helper methods:
SAML::attributes()- get all SAML attributes for the currently logged in userSAML::attribute($key)- get the specified SAML attribute for the currently logged in user (usedata_get()dotted notation, e.g.email.0)SAML::string loginUrl(string $redirectTo, array $params = [])- returns a URL for the SAML server login pageSAML::string reauthUrl(string $redirectTo, array $params = [])- forces re-authentication even if the user is already logged inSAML::string passiveLoginUrl(string $redirectTo, array $params = [])- checks if the user is already logged in but may redirect back without them authenticating (TODO: Untested)
SAML::string logoutUrl(string $redirectTo, array $params = [])- returns a URL for the SAML server logout pageSAML::attributesToUser(array $attributes)- converts the attributes array from SAML to a User object (ornull), using the following helpers:SAML::findOrCreateUserUsingConfig(array $attributes)- the default implementation (can be called directly from theattributesToUserCallback()callback)SAML::findUser(array $attributes, array $matchFields = [], array $setFields = [])- finds a user but doesn't create oneSAML::findOrCreateUser(array $attributes, array $matchFields = [], array $setFields = [])- finds or creates a user
SAML::auth()- get the underlyingOneLogin\Saml2\Authinstance
Note: There are a couple more that are for internal use only and should not be called directly:
SAML::redirect(string $url)SAML::accessDenied(array $attributes)