SimpleSAML_Auth_Simple::getAuthSource PHP Method

getAuthSource() public method

Retrieve the implementing authentication source.
public getAuthSource ( ) : SimpleSAML_Auth_Source
return SimpleSAML_Auth_Source The authentication source.
    public function getAuthSource()
    {
        $as = SimpleSAML_Auth_Source::getById($this->authSource);
        if ($as === null) {
            throw new SimpleSAML_Error_AuthSource($this->authSource, 'Unknown authentication source.');
        }
        return $as;
    }

Usage Example

Beispiel #1
0
 /**
  * Re-authenticate the user.
  *
  * This function re-authenticates an user with an existing session. This gives the authentication source a chance
  * to do additional work when re-authenticating for SSO.
  *
  * Note: This function is not used when ForceAuthn=true.
  *
  * @param array &$state The authentication request state.
  *
  * @throws SimpleSAML_Error_Exception If there is no auth source defined for this IdP.
  */
 private function reauthenticate(array &$state)
 {
     $sourceImpl = $this->authSource->getAuthSource();
     if ($sourceImpl === null) {
         throw new SimpleSAML_Error_Exception('No such auth source defined.');
     }
     $sourceImpl->reauthenticate($state);
 }
All Usage Examples Of SimpleSAML_Auth_Simple::getAuthSource