PHP Class SAML2\AuthnRequest

Inheritance: extends Request
显示文件 Open project: simplesamlphp/saml2 Class Usage Examples

Public Methods

Method Description
__construct ( DOMElement $xml = null ) Constructor for SAML 2 authentication request messages.
decryptNameId ( XMLSecurityKey $key, array $blacklist = [] ) Decrypt the NameId of the subject in the assertion.
encryptNameId ( XMLSecurityKey $key ) Encrypt the NameID in the AuthnRequest.
getAssertionConsumerServiceIndex ( ) : integer | null Retrieve the value of the AssertionConsumerServiceIndex attribute.
getAssertionConsumerServiceURL ( ) : string | null Retrieve the value of the AssertionConsumerServiceURL attribute.
getAttributeConsumingServiceIndex ( ) : integer | null Retrieve the value of the AttributeConsumingServiceIndex attribute.
getForceAuthn ( ) : boolean Retrieve the value of the ForceAuthn attribute.
getIDPList ( ) : array This function retrieves the list of providerIDs from this authentication request.
getIsPassive ( ) : boolean Retrieve the value of the IsPassive attribute.
getNameId ( ) : array | null Retrieve the NameId of the subject in the assertion.
getNameIdPolicy ( ) : array Retrieve the NameIdPolicy.
getProtocolBinding ( ) : string | null Retrieve the value of the ProtocolBinding attribute.
getProviderName ( ) : string Retrieve the value of the ProviderName attribute.
getProxyCount ( ) : integer
getRequestedAuthnContext ( ) : array | null Retrieve the RequestedAuthnContext.
getRequesterID ( ) : array
getSubjectConfirmation ( ) : SAML2\XML\saml\SubjectConfirmation[] Retrieve the SubjectConfirmation elements we have in our Subject element.
setAssertionConsumerServiceIndex ( integer | null $assertionConsumerServiceIndex ) Set the value of the AssertionConsumerServiceIndex attribute.
setAssertionConsumerServiceURL ( string | null $assertionConsumerServiceURL ) Set the value of the AssertionConsumerServiceURL attribute.
setAttributeConsumingServiceIndex ( integer | null $attributeConsumingServiceIndex ) Set the value of the AttributeConsumingServiceIndex attribute.
setForceAuthn ( boolean $forceAuthn ) Set the value of the ForceAuthn attribute.
setIDPList ( $IDPList ) This function sets the scoping for the request.
setIsPassive ( boolean $isPassive ) Set the value of the IsPassive attribute.
setNameId ( array | null $nameId ) Set the NameId of the subject in the assertion.
setNameIdPolicy ( array $nameIdPolicy ) Set the NameIDPolicy.
setProtocolBinding ( string $protocolBinding ) Set the value of the ProtocolBinding attribute.
setProviderName ( string $ProviderName ) Set the value of the ProviderName attribute.
setProxyCount ( integer $ProxyCount )
setRequestedAuthnContext ( array | null $requestedAuthnContext ) Set the RequestedAuthnContext.
setRequesterID ( array $RequesterID )
setSubjectConfirmation ( array $subjectConfirmation ) Set the SubjectConfirmation elements that should be included in the assertion.
toUnsignedXML ( ) : DOMElement Convert this authentication request to an XML element.

Protected Methods

Method Description
parseNameIdPolicy ( DOMElement $xml )
parseRequestedAuthnContext ( DOMElement $xml )
parseScoping ( DOMElement $xml )

Private Methods

Method Description
addSubject ( DOMElement $root ) Add a Subject-node to the assertion.
parseSubject ( DOMElement $xml )

Method Details

__construct() public method

Constructor for SAML 2 authentication request messages.
public __construct ( DOMElement $xml = null )
$xml DOMElement The input message.

decryptNameId() public method

Decrypt the NameId of the subject in the assertion.
public decryptNameId ( XMLSecurityKey $key, array $blacklist = [] )
$key RobRichards\XMLSecLibs\XMLSecurityKey The decryption key.
$blacklist array Blacklisted decryption algorithms.

encryptNameId() public method

Encrypt the NameID in the AuthnRequest.
public encryptNameId ( XMLSecurityKey $key )
$key RobRichards\XMLSecLibs\XMLSecurityKey The encryption key.

getAssertionConsumerServiceIndex() public method

Retrieve the value of the AssertionConsumerServiceIndex attribute.
public getAssertionConsumerServiceIndex ( ) : integer | null
return integer | null The AssertionConsumerServiceIndex attribute.

getAssertionConsumerServiceURL() public method

Retrieve the value of the AssertionConsumerServiceURL attribute.
public getAssertionConsumerServiceURL ( ) : string | null
return string | null The AssertionConsumerServiceURL attribute.

getAttributeConsumingServiceIndex() public method

Retrieve the value of the AttributeConsumingServiceIndex attribute.
public getAttributeConsumingServiceIndex ( ) : integer | null
return integer | null The AttributeConsumingServiceIndex attribute.

getForceAuthn() public method

Retrieve the value of the ForceAuthn attribute.
public getForceAuthn ( ) : boolean
return boolean The ForceAuthn attribute.

getIDPList() public method

Currently we only support a list of ipd ientity id's.
public getIDPList ( ) : array
return array List of idp EntityIDs from the request

getIsPassive() public method

Retrieve the value of the IsPassive attribute.
public getIsPassive ( ) : boolean
return boolean The IsPassive attribute.

getNameId() public method

The returned NameId is in the format used by \SAML2\Utils::addNameId().
See also: SAML2\Utils::addNameId()
public getNameId ( ) : array | null
return array | null The name identifier of the assertion.

getNameIdPolicy() public method

Retrieve the NameIdPolicy.
See also: SAML2\AuthnRequest::setNameIdPolicy()
public getNameIdPolicy ( ) : array
return array The NameIdPolicy.

getProtocolBinding() public method

Retrieve the value of the ProtocolBinding attribute.
public getProtocolBinding ( ) : string | null
return string | null The ProtocolBinding attribute.

getProviderName() public method

Retrieve the value of the ProviderName attribute.
public getProviderName ( ) : string
return string The ProviderName attribute.

getProxyCount() public method

public getProxyCount ( ) : integer
return integer

getRequestedAuthnContext() public method

Retrieve the RequestedAuthnContext.
public getRequestedAuthnContext ( ) : array | null
return array | null The RequestedAuthnContext.

getRequesterID() public method

public getRequesterID ( ) : array
return array

getSubjectConfirmation() public method

Retrieve the SubjectConfirmation elements we have in our Subject element.
public getSubjectConfirmation ( ) : SAML2\XML\saml\SubjectConfirmation[]
return SAML2\XML\saml\SubjectConfirmation[]

parseNameIdPolicy() protected method

protected parseNameIdPolicy ( DOMElement $xml )
$xml DOMElement

parseRequestedAuthnContext() protected method

protected parseRequestedAuthnContext ( DOMElement $xml )
$xml DOMElement

parseScoping() protected method

protected parseScoping ( DOMElement $xml )
$xml DOMElement

setAssertionConsumerServiceIndex() public method

Set the value of the AssertionConsumerServiceIndex attribute.
public setAssertionConsumerServiceIndex ( integer | null $assertionConsumerServiceIndex )
$assertionConsumerServiceIndex integer | null The AssertionConsumerServiceIndex attribute.

setAssertionConsumerServiceURL() public method

Set the value of the AssertionConsumerServiceURL attribute.
public setAssertionConsumerServiceURL ( string | null $assertionConsumerServiceURL )
$assertionConsumerServiceURL string | null The AssertionConsumerServiceURL attribute.

setAttributeConsumingServiceIndex() public method

Set the value of the AttributeConsumingServiceIndex attribute.
public setAttributeConsumingServiceIndex ( integer | null $attributeConsumingServiceIndex )
$attributeConsumingServiceIndex integer | null The AttributeConsumingServiceIndex attribute.

setForceAuthn() public method

Set the value of the ForceAuthn attribute.
public setForceAuthn ( boolean $forceAuthn )
$forceAuthn boolean The ForceAuthn attribute.

setIDPList() public method

See Core 3.4.1.2 for the definition of scoping. Currently we support an IDPList of idpEntries. Each idpEntries consists of an array, containing keys (mapped to attributes) and corresponding values. Allowed attributes: Loc, Name, ProviderID. For backward compatibility, an idpEntries can also be a string instead of an array, where each string is mapped to the value of attribute ProviderID.
public setIDPList ( $IDPList )

setIsPassive() public method

Set the value of the IsPassive attribute.
public setIsPassive ( boolean $isPassive )
$isPassive boolean The IsPassive attribute.

setNameId() public method

The NameId must be in the format accepted by \SAML2\Utils::addNameId().
See also: SAML2\Utils::addNameId()
public setNameId ( array | null $nameId )
$nameId array | null The name identifier of the assertion.

setNameIdPolicy() public method

This function accepts an array with the following options: - 'Format' - 'SPNameQualifier' - 'AllowCreate'
public setNameIdPolicy ( array $nameIdPolicy )
$nameIdPolicy array The NameIDPolicy.

setProtocolBinding() public method

Set the value of the ProtocolBinding attribute.
public setProtocolBinding ( string $protocolBinding )
$protocolBinding string The ProtocolBinding attribute.

setProviderName() public method

Set the value of the ProviderName attribute.
public setProviderName ( string $ProviderName )
$ProviderName string The ProviderName attribute.

setProxyCount() public method

public setProxyCount ( integer $ProxyCount )
$ProxyCount integer

setRequestedAuthnContext() public method

Set the RequestedAuthnContext.
public setRequestedAuthnContext ( array | null $requestedAuthnContext )
$requestedAuthnContext array | null The RequestedAuthnContext.

setRequesterID() public method

public setRequesterID ( array $RequesterID )
$RequesterID array

setSubjectConfirmation() public method

Set the SubjectConfirmation elements that should be included in the assertion.
public setSubjectConfirmation ( array $subjectConfirmation )
$subjectConfirmation array

toUnsignedXML() public method

Convert this authentication request to an XML element.
public toUnsignedXML ( ) : DOMElement
return DOMElement This authentication request.