Properties

$_paths

$_paths : array

List of paths.

Type

array

$_baseurl

$_baseurl : string

Type

string

$_strict

$_strict : boolean

Strict. If active, PHP Toolkit will reject unsigned or unencrypted messages if it expects them signed or encrypted. If not, the messages will be accepted and some security issues will be also relaxed.

Type

boolean

$_debug

$_debug : boolean

Activate debug mode

Type

boolean

$_sp

$_sp : array

SP data.

Type

array

$_idp

$_idp : array

IdP data.

Type

array

$_compress

$_compress : array

Compression settings that determine whether gzip compression should be used.

Type

array

$_security

$_security : array

Security Info related to the SP.

Type

array

$_contacts

$_contacts : array

Setting contacts.

Type

array

$_organization

$_organization : array

Setting organization.

Type

array

$_errors

$_errors : array

Setting errors.

Type

array

$_spValidationOnly

$_spValidationOnly : boolean

Setting errors.

Type

boolean

Methods

__construct()

__construct(array|object|null  $settings = null, boolean  $spValidationOnly = false) 

Initializes the settings: - Sets the paths of the different folders - Loads settings info from settings file or array/object provided

Parameters

array|object|null $settings

SAML Toolkit Settings

boolean $spValidationOnly

Throws

\OneLogin_Saml2_Error

If any settings parameter is invalid

\Exception

If OneLogin_Saml2_Settings is incorrectly supplied

getBasePath()

getBasePath() : string

Returns base path.

Returns

string —

The base toolkit folder path

getCertPath()

getCertPath() : string

Returns cert path.

Returns

string —

The cert folder path

getConfigPath()

getConfigPath() : string

Returns config path.

Returns

string —

The config folder path

getLibPath()

getLibPath() : string

Returns lib path.

Returns

string —

The library folder path

getExtLibPath()

getExtLibPath() : string

Returns external lib path.

Returns

string —

The external library folder path

getSchemasPath()

getSchemasPath() : string

Returns schema path.

Returns

string —

The external library folder path

setSchemasPath()

setSchemasPath(string  $path) : $this

Set schemas path

Parameters

string $path

Returns

$this

checkSettings()

checkSettings(array  $settings) : array

Checks the settings info.

Parameters

array $settings

Array with settings data

Returns

array —

$errors Errors found on the settings data

checkCompressionSettings()

checkCompressionSettings(array  $settings) : array

Checks the compression settings info.

Parameters

array $settings

Array with settings data

Returns

array —

$errors Errors found on the settings data

checkIdPSettings()

checkIdPSettings(array  $settings) : array

Checks the IdP settings info.

Parameters

array $settings

Array with settings data

Returns

array —

$errors Errors found on the IdP settings data

checkSPSettings()

checkSPSettings(array  $settings) : array

Checks the SP settings info.

Parameters

array $settings

Array with settings data

Returns

array —

$errors Errors found on the SP settings data

checkSPCerts()

checkSPCerts() : boolean

Checks if the x509 certs of the SP exists and are valid.

Returns

boolean

getSPkey()

getSPkey() : string

Returns the x509 private key of the SP.

Returns

string —

SP private key

getSPcert()

getSPcert() : string

Returns the x509 public cert of the SP.

Returns

string —

SP public cert

getSPcertNew()

getSPcertNew() : string

Returns the x509 public of the SP that is planed to be used soon instead the other public cert

Returns

string —

SP public cert New

getIdPData()

getIdPData() : array

Gets the IdP data.

Returns

array —

IdP info

getSPData()

getSPData() : array

Gets the SP data.

Returns

array —

SP info

getSecurityData()

getSecurityData() : array

Gets security data.

Returns

array —

SP info

getContacts()

getContacts() : array

Gets contact data.

Returns

array —

SP info

getOrganization()

getOrganization() : array

Gets organization data.

Returns

array —

SP info

shouldCompressRequests()

shouldCompressRequests() : boolean

Should SAML requests be compressed?

Returns

boolean —

Yes/No as True/False

shouldCompressResponses()

shouldCompressResponses() : boolean

Should SAML responses be compressed?

Returns

boolean —

Yes/No as True/False

getIdPSSOUrl()

getIdPSSOUrl() : string|null

Gets the IdP SSO url.

Returns

string|null —

The url of the IdP Single Sign On Service

getIdPSLOUrl()

getIdPSLOUrl() : string|null

Gets the IdP SLO url.

Returns

string|null —

The request url of the IdP Single Logout Service

getIdPSLOResponseUrl()

getIdPSLOResponseUrl() : string|null

Gets the IdP SLO response url.

Returns

string|null —

The response url of the IdP Single Logout Service

getSPMetadata()

getSPMetadata(boolean  $alwaysPublishEncryptionCert = false, \DateTime|null  $validUntil = null, integer|null  $cacheDuration = null) : string

Gets the SP metadata. The XML representation.

Parameters

boolean $alwaysPublishEncryptionCert

When 'true', the returned metadata will always include an 'encryption' KeyDescriptor. Otherwise, the 'encryption' KeyDescriptor will only be included if $advancedSettings['security']['wantNameIdEncrypted'] or $advancedSettings['security']['wantAssertionsEncrypted'] are enabled.

\DateTime|null $validUntil

Metadata's valid time

integer|null $cacheDuration

Duration of the cache in seconds

Throws

\Exception
\OneLogin_Saml2_Error

Returns

string —

SP metadata (xml)

validateMetadata()

validateMetadata(string  $xml) : Array

Validates an XML SP Metadata.

Parameters

string $xml

Metadata's XML that will be validate

Throws

\Exception

Returns

Array —

The list of found errors

formatIdPCert()

formatIdPCert() 

Formats the IdP cert.

formatIdPCertMulti()

formatIdPCertMulti() 

Formats the Multple IdP certs.

formatSPCert()

formatSPCert() 

Formats the SP cert.

formatSPCertNew()

formatSPCertNew() 

Formats the SP cert.

formatSPKey()

formatSPKey() 

Formats the SP private key.

getErrors()

getErrors() : array

Returns an array with the errors, the array is empty when the settings is ok.

Returns

array —

Errors

setStrict()

setStrict(boolean  $value) 

Activates or deactivates the strict mode.

Parameters

boolean $value

Strict parameter

Throws

\Exception

isStrict()

isStrict() : boolean

Returns if the 'strict' mode is active.

Returns

boolean —

Strict parameter

isDebugActive()

isDebugActive() : boolean

Returns if the debug is active.

Returns

boolean —

Debug parameter

setBaseURL()

setBaseURL(  $baseurl) 

Set a baseurl value.

Parameters

$baseurl

getBaseURL()

getBaseURL() : null|string

Returns the baseurl set on the settings if any.

Returns

null|string —

The baseurl

setIdPCert()

setIdPCert(string  $cert) 

Sets the IdP certificate.

Parameters

string $cert

IdP certificate

_loadPaths()

_loadPaths() 

Sets the paths of the different folders

_loadSettingsFromArray()

_loadSettingsFromArray(array  $settings) : boolean

Loads settings info from a settings Array

Parameters

array $settings

SAML Toolkit Settings

Returns

boolean —

True if the settings info is valid

_loadSettingsFromFile()

_loadSettingsFromFile() : boolean

Loads settings info from the settings file

Throws

\OneLogin_Saml2_Error

Returns

boolean —

True if the settings info is valid

_addDefaultValues()

_addDefaultValues() 

Add default values if the settings info is not complete