PHP Interface Neos\Flow\Security\Authentication\TokenInterface

Mostra file Open project: neos/flow-development-collection Interface Usage Examples

Public Methods

Method Description
__toString ( ) : string Returns a string representation of the token for logging purposes.
getAccount ( ) : Account Returns the account if one is authenticated, NULL otherwise.
getAuthenticationEntryPoint ( ) : Neos\Flow\Security\Authentication\EntryPointInterface Returns the configured authentication entry point, NULL if none is available
getAuthenticationProviderName ( ) : string Returns the name of the authentication provider responsible for this token
getAuthenticationStatus ( ) : integer Returns the current authentication status
getCredentials ( ) : mixed Returns the credentials of this token. The type depends on the provider of the token.
getRequestPatterns ( ) : array Returns an array of set \Neos\Flow\Security\RequestPatternInterface, NULL if none was set
hasRequestPatterns ( ) : boolean Returns TRUE if \Neos\Flow\Security\RequestPattern were set
isAuthenticated ( ) : boolean Returns TRUE if this token is currently authenticated
setAccount ( Account $account = null ) : void Set the (authenticated) account
setAuthenticationEntryPoint ( Neos\Flow\Security\Authentication\EntryPointInterface $entryPoint ) : void Sets the authentication entry point
setAuthenticationProviderName ( string $authenticationProviderName ) : void Sets the name of the authentication provider responsible for this token
setAuthenticationStatus ( integer $authenticationStatus ) : void Sets the authentication status. Usually called by the responsible AuthenticationManagerInterface
setRequestPatterns ( array $requestPatterns ) : void Sets request patterns
updateCredentials ( ActionRequest $actionRequest ) : boolean Updates the authentication credentials, the authentication manager needs to authenticate this token.

Method Details

__toString() public method

Returns a string representation of the token for logging purposes.
public __toString ( ) : string
return string A string representation of the token

getAccount() public method

Returns the account if one is authenticated, NULL otherwise.
public getAccount ( ) : Account
return Neos\Flow\Security\Account An account object

getAuthenticationEntryPoint() public method

Returns the configured authentication entry point, NULL if none is available
public getAuthenticationEntryPoint ( ) : Neos\Flow\Security\Authentication\EntryPointInterface
return Neos\Flow\Security\Authentication\EntryPointInterface The configured authentication entry point, NULL if none is available

getAuthenticationProviderName() public method

Returns the name of the authentication provider responsible for this token
public getAuthenticationProviderName ( ) : string
return string The authentication provider name

getAuthenticationStatus() public method

Returns the current authentication status
public getAuthenticationStatus ( ) : integer
return integer One of NO_CREDENTIALS_GIVEN, WRONG_CREDENTIALS, AUTHENTICATION_SUCCESSFUL, REAUTHENTICATION_NEEDED

getCredentials() public method

Returns the credentials of this token. The type depends on the provider of the token.
public getCredentials ( ) : mixed
return mixed $credentials The needed credentials to authenticate this token

getRequestPatterns() public method

Returns an array of set \Neos\Flow\Security\RequestPatternInterface, NULL if none was set
See also: hasRequestPattern()
public getRequestPatterns ( ) : array
return array Array of set request patterns

hasRequestPatterns() public method

Returns TRUE if \Neos\Flow\Security\RequestPattern were set
public hasRequestPatterns ( ) : boolean
return boolean True if a \Neos\Flow\Security\RequestPatternInterface was set

isAuthenticated() public method

Returns TRUE if this token is currently authenticated
public isAuthenticated ( ) : boolean
return boolean TRUE if this this token is currently authenticated

setAccount() public method

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

setAuthenticationEntryPoint() public method

Sets the authentication entry point
public setAuthenticationEntryPoint ( Neos\Flow\Security\Authentication\EntryPointInterface $entryPoint ) : void
$entryPoint Neos\Flow\Security\Authentication\EntryPointInterface The authentication entry point
return void

setAuthenticationProviderName() public method

Sets the name of the authentication provider responsible for this token
public setAuthenticationProviderName ( string $authenticationProviderName ) : void
$authenticationProviderName string The authentication provider name
return void

setAuthenticationStatus() public method

Sets the authentication status. Usually called by the responsible AuthenticationManagerInterface
public setAuthenticationStatus ( integer $authenticationStatus ) : void
$authenticationStatus integer One of NO_CREDENTIALS_GIVEN, WRONG_CREDENTIALS, AUTHENTICATION_SUCCESSFUL
return void

setRequestPatterns() public method

Sets request patterns
See also: hasRequestPattern()
public setRequestPatterns ( array $requestPatterns ) : void
$requestPatterns array Array of \Neos\Flow\Security\RequestPatternInterface to be set
return void

updateCredentials() public method

This could be a username/password from a login controller. This method is called while initializing the security context. By returning TRUE you make sure that the authentication manager will (re-)authenticate the tokens with the current credentials. Note: You should not persist the credentials!
public updateCredentials ( ActionRequest $actionRequest ) : boolean
$actionRequest Neos\Flow\Mvc\ActionRequest The current request instance
return boolean TRUE if this token needs to be (re-)authenticated