$_settings
$_settings : \OneLogin_Saml2_Settings
Settings data.
Main class of PHP Toolkit
$_settings : \OneLogin_Saml2_Settings
Settings data.
__construct(array|object|null $oldSettings = null, boolean $spValidationOnly = false)
Initializes the SP SAML instance.
array|object|null | $oldSettings | Setting data (You can provide a OneLogin_Saml_Settings, the settings object of the Saml folder implementation) |
boolean | $spValidationOnly | if you only as an SP , you should set it to false if not you should set it to true |
getSettings() : \OneLogin_Saml2_Settings
Returns the settings info
The settings data.
processSLO(boolean $keepLocalSession = false, string|null $requestId = null, boolean $retrieveParametersFromServer = false, callable $cbDeleteSession = null, boolean $stay = false) : string|null
Process the SAML Logout Response / Logout Request sent by the IdP.
boolean | $keepLocalSession | When false will destroy the local session, otherwise will keep it |
string|null | $requestId | The ID of the LogoutRequest sent by this SP to the IdP |
boolean | $retrieveParametersFromServer | True if we want to use parameters from $_SERVER to validate the signature |
callable | $cbDeleteSession | Callback to be executed to delete session |
boolean | $stay | True if we want to stay (returns the url string) False to redirect |
redirectTo(string $url = '', array $parameters = array(), boolean $stay = false) : string|null
Redirects the user to the url past by parameter or to the url that we defined in our SSO Request.
string | $url | The target URL to redirect the user. |
array | $parameters | Extra parameters to be passed as part of the url |
boolean | $stay | True if we want to stay (returns the url string) False to redirect |
login(string|null $returnTo = null, array $parameters = array(), boolean $forceAuthn = false, boolean $isPassive = false, boolean $stay = false, boolean $setNameIdPolicy = true, string $nameIdValueReq = null) : string|null
Initiates the SSO process.
string|null | $returnTo | The target URL the user should be returned to after login. |
array | $parameters | Extra parameters to be added to the GET |
boolean | $forceAuthn | When true the AuthNRequest will set the ForceAuthn='true' |
boolean | $isPassive | When true the AuthNRequest will set the Ispassive='true' |
boolean | $stay | True if we want to stay (returns the url string) False to redirect |
boolean | $setNameIdPolicy | When true the AuthNRueqest will set a nameIdPolicy element |
string | $nameIdValueReq | Indicates to the IdP the subject that should be authenticated |
If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters
logout(string|null $returnTo = null, array $parameters = array(), string|null $nameId = null, string|null $sessionIndex = null, boolean $stay = false, string|null $nameIdFormat = null, string|null $nameIdNameQualifier = null, $nameIdSPNameQualifier = null) : string|null
Initiates the SLO process.
string|null | $returnTo | The target URL the user should be returned to after logout. |
array | $parameters | Extra parameters to be added to the GET |
string|null | $nameId | The NameID that will be set in the LogoutRequest. |
string|null | $sessionIndex | The SessionIndex (taken from the SAML Response in the SSO process). |
boolean | $stay | True if we want to stay (returns the url string) False to redirect |
string|null | $nameIdFormat | The NameID Format will be set in the LogoutRequest. |
string|null | $nameIdNameQualifier | The NameID NameQualifier will be set in the LogoutRequest. |
$nameIdSPNameQualifier |
If $stay is True, it return a string with the SLO URL + LogoutRequest + parameters
buildRequestSignature(string $samlRequest, string $relayState, string $signAlgorithm = \XMLSecurityKey::RSA_SHA1) : string
Generates the Signature for a SAML Request
string | $samlRequest | The SAML Request |
string | $relayState | The RelayState |
string | $signAlgorithm | Signature algorithm method |
A base64 encoded signature
buildResponseSignature(string $samlResponse, string $relayState, string $signAlgorithm = \XMLSecurityKey::RSA_SHA1) : string
Generates the Signature for a SAML Response
string | $samlResponse | The SAML Response |
string | $relayState | The RelayState |
string | $signAlgorithm | Signature algorithm method |
A base64 encoded signature
buildMessageSignature(string $samlMessage, string $relayState, string $signAlgorithm = \XMLSecurityKey::RSA_SHA256, string $type = "SAMLRequest") : string
Generates the Signature for a SAML Response
string | $samlMessage | The SAML Response |
string | $relayState | The RelayState |
string | $signAlgorithm | Signature algorithm method |
string | $type | "SAMLRequest" or "SAMLResponse" |
A base64 encoded signature