class Saml2Service

Methods

__construct(IdpResolver $idpResolver, MetadataParser $metadataParser)

No description

array
buildSettings(Saml2Idp|string $idp)

Build onelogin/php-saml settings array for an IDP.

Auth
getAuth(Saml2Idp|string $idp)

Get a configured Auth instance for an IDP.

string
login(string $idpKey, string|null $returnTo = null)

Initiate SSO login for an IDP.

array
processAcsResponse(string $idpKey)

Process the ACS (Assertion Consumer Service) response.

array
processAcsResponseAuto()

Process ACS response by extracting the Issuer (IDP EntityID) from the SAML response.

array
processAcsWithIdp(Saml2Idp $idp)

Process ACS with a resolved IDP.

string|null
extractIssuerFromResponse(string $xml)

Extract the Issuer element from a SAML response XML.

string
logout(string $idpKey, string|null $returnTo = null, string|null $nameId = null, string|null $sessionIndex = null)

Initiate SLO logout.

string|null
processSlo(string $idpKey, callable|null $cbDeleteSession = null, string|null $nameId = null, string|null $sessionIndex = null)

Process the SLS (Single Logout Service) response/request.

string
getMetadataXml()

Generate SP metadata XML, with optional caching.

string
generateMetadataXml()

Generate SP metadata XML.

array
mapAttributes(array $attributes, Saml2Idp|null $idp = null)

Map SAML attributes using the IDP-specific or global mapping.

getIdpResolver()

Get the IDP resolver instance.

getMetadataParser()

Get the metadata parser instance.

Details

at line 17
__construct(IdpResolver $idpResolver, MetadataParser $metadataParser)

No description

Parameters

IdpResolver $idpResolver
MetadataParser $metadataParser

at line 25
array buildSettings(Saml2Idp|string $idp)

Build onelogin/php-saml settings array for an IDP.

Parameters

Saml2Idp|string $idp

Return Value

array

at line 80
Auth getAuth(Saml2Idp|string $idp)

Get a configured Auth instance for an IDP.

Parameters

Saml2Idp|string $idp

Return Value

Auth

at line 89
string login(string $idpKey, string|null $returnTo = null)

Initiate SSO login for an IDP.

Parameters

string $idpKey
string|null $returnTo

Return Value

string

at line 103
array processAcsResponse(string $idpKey)

Process the ACS (Assertion Consumer Service) response.

Returns the parsed SAML data and dispatches Saml2LoginEvent.

Parameters

string $idpKey

Return Value

array

at line 118
array processAcsResponseAuto()

Process ACS response by extracting the Issuer (IDP EntityID) from the SAML response.

This allows a single ACS URL for all IDPs.

Return Value

array

at line 147
protected array processAcsWithIdp(Saml2Idp $idp)

Process ACS with a resolved IDP.

Parameters

Saml2Idp $idp

Return Value

array

at line 194
protected string|null extractIssuerFromResponse(string $xml)

Extract the Issuer element from a SAML response XML.

Parameters

string $xml

Return Value

string|null

at line 220
string logout(string $idpKey, string|null $returnTo = null, string|null $nameId = null, string|null $sessionIndex = null)

Initiate SLO logout.

Parameters

string $idpKey
string|null $returnTo
string|null $nameId
string|null $sessionIndex

Return Value

string

at line 235
string|null processSlo(string $idpKey, callable|null $cbDeleteSession = null, string|null $nameId = null, string|null $sessionIndex = null)

Process the SLS (Single Logout Service) response/request.

Parameters

string $idpKey
callable|null $cbDeleteSession

Callback to handle session deletion

string|null $nameId
string|null $sessionIndex

Return Value

string|null

at line 260
string getMetadataXml()

Generate SP metadata XML, with optional caching.

Return Value

string

at line 274
protected string generateMetadataXml()

Generate SP metadata XML.

Return Value

string

at line 323
protected array mapAttributes(array $attributes, Saml2Idp|null $idp = null)

Map SAML attributes using the IDP-specific or global mapping.

Parameters

array $attributes
Saml2Idp|null $idp

Return Value

array

at line 345
IdpResolver getIdpResolver()

Get the IDP resolver instance.

Return Value

IdpResolver

at line 353
MetadataParser getMetadataParser()

Get the metadata parser instance.

Return Value

MetadataParser