\OneLogin_Saml2_IdPMetadataParser

IdP Metadata Parser of PHP Toolkit

Summary

Methods
Properties
Constants
parseRemoteXML()
parseFileXML()
parseXML()
injectIntoSettings()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

parseRemoteXML()

parseRemoteXML(string  $url, string  $entityId = null, string  $desiredNameIdFormat = null, string  $desiredSSOBinding = \OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, string  $desiredSLOBinding = \OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT) : array

Get IdP Metadata Info from URL

This class does not validate in any way the URL that is introduced, make sure to validate it properly before use it in the parseRemoteXML method in order to avoid security issues like SSRF attacks.

Parameters

string $url

URL where the IdP metadata is published

string $entityId

Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned

string $desiredNameIdFormat

If available on IdP metadata, use that nameIdFormat

string $desiredSSOBinding

Parse specific binding SSO endpoint.

string $desiredSLOBinding

Parse specific binding SLO endpoint.

Returns

array —

metadata info in php-saml settings format

parseFileXML()

parseFileXML(string  $filepath, string  $entityId = null, string  $desiredNameIdFormat = null, string  $desiredSSOBinding = \OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, string  $desiredSLOBinding = \OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT) : array

Get IdP Metadata Info from File

Parameters

string $filepath

File path

string $entityId

Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned

string $desiredNameIdFormat

If available on IdP metadata, use that nameIdFormat

string $desiredSSOBinding

Parse specific binding SSO endpoint.

string $desiredSLOBinding

Parse specific binding SLO endpoint.

Returns

array —

metadata info in php-saml settings format

parseXML()

parseXML(string  $xml, string  $entityId = null, string  $desiredNameIdFormat = null, string  $desiredSSOBinding = \OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT, string  $desiredSLOBinding = \OneLogin_Saml2_Constants::BINDING_HTTP_REDIRECT) : array

Get IdP Metadata Info from URL

Parameters

string $xml

XML that contains IdP metadata

string $entityId

Entity Id of the desired IdP, if no entity Id is provided and the XML metadata contains more than one IDPSSODescriptor, the first is returned

string $desiredNameIdFormat

If available on IdP metadata, use that nameIdFormat

string $desiredSSOBinding

Parse specific binding SSO endpoint.

string $desiredSLOBinding

Parse specific binding SLO endpoint.

Throws

\Exception

Returns

array —

metadata info in php-saml settings format

injectIntoSettings()

injectIntoSettings(array  $settings, array  $metadataInfo) : array

Inject metadata info into php-saml settings array

Parameters

array $settings

php-saml settings array

array $metadataInfo

array metadata info

Returns

array —

settings