Neos\Flow\Security\Authentication\TokenInterface::setAccount PHP Method

setAccount() public method

Set the (authenticated) account
public setAccount ( Account $account = null ) : void
$account Neos\Flow\Security\Account An account object
return void
    public function setAccount(Account $account = null);

Usage Example

 /**
  * Sets isAuthenticated to TRUE for all tokens.
  *
  * @param TokenInterface $authenticationToken The token to be authenticated
  * @return void
  */
 public function authenticate(TokenInterface $authenticationToken)
 {
     $authenticationToken->setAuthenticationStatus($this->authenticationStatus);
     if ($this->authenticationStatus === TokenInterface::AUTHENTICATION_SUCCESSFUL) {
         $authenticationToken->setAccount($this->account);
     } else {
         $authenticationToken->setAccount(null);
     }
 }
All Usage Examples Of Neos\Flow\Security\Authentication\TokenInterface::setAccount