SAML2\Message::getRelayState PHP Method

getRelayState() public method

Retrieve the RelayState associated with this message.
public getRelayState ( ) : string | null
return string | null The RelayState, or NULL if no RelayState is given
    public function getRelayState()
    {
        return $this->relayState;
    }

Usage Example

示例#1
0
 /**
  * Create the redirect URL for a message.
  *
  * @param  \SAML2\Message $message The message.
  * @return string        The URL the user should be redirected to in order to send a message.
  * @throws \Exception
  */
 public function getRedirectURL(Message $message)
 {
     $store = SimpleSAML_Store::getInstance();
     if ($store === false) {
         throw new \Exception('Unable to send artifact without a datastore configured.');
     }
     $generatedId = pack('H*', (string) SimpleSAML_Utilities::stringToHex(SimpleSAML_Utilities::generateRandomBytes(20)));
     $artifact = base64_encode("" . sha1($message->getIssuer(), true) . $generatedId);
     $artifactData = $message->toUnsignedXML();
     $artifactDataString = $artifactData->ownerDocument->saveXML($artifactData);
     $store->set('artifact', $artifact, $artifactDataString, Temporal::getTime() + 15 * 60);
     $params = array('SAMLart' => $artifact);
     $relayState = $message->getRelayState();
     if ($relayState !== null) {
         $params['RelayState'] = $relayState;
     }
     return SimpleSAML_Utilities::addURLparameter($message->getDestination(), $params);
 }
All Usage Examples Of SAML2\Message::getRelayState