phpCAS::setPostAuthenticateCallback PHP Method

setPostAuthenticateCallback() public static method

The callback function will be passed a $logoutTicket as its first parameter, followed by any $additionalArgs you pass. The $logoutTicket parameter is an opaque string that can be used to map the session-id to logout request in order to support single-signout in applications that manage their own sessions (rather than letting phpCAS start the session). phpCAS::forceAuthentication() will always exit and forward client unless they are already authenticated. To perform an action at the moment the user logs in (such as registering an account, performing logging, etc), register a callback function here.
public static setPostAuthenticateCallback ( string $function, array $additionalArgs = [] ) : void
$function string Callback function
$additionalArgs array optional array of arguments
return void
    public static function setPostAuthenticateCallback($function, array $additionalArgs = array())
    {
        phpCAS::_validateClientExists();
        self::$_PHPCAS_CLIENT->setPostAuthenticateCallback($function, $additionalArgs);
    }

Usage Example

Ejemplo n.º 1
0
 public function __construct()
 {
     $setup = self::loadSetup();
     $this->client = phpCAS::client(CAS_VERSION_2_0, $setup['host'], $setup['port'], $setup['context']);
     // For simplicities sake at the moment we are not validating the server auth.
     phpCAS::setNoCasServerValidation();
     phpCAS::setPostAuthenticateCallback(array($this, 'loginCallback'));
 }
All Usage Examples Of phpCAS::setPostAuthenticateCallback