TokenInterface
interface TokenInterface (View source)
Contract for an authentication token.
Constants
NO_CREDENTIALS_GIVEN |
This is the default state. The token is not authenticated and holds no credentials, that could be used for authentication. |
WRONG_CREDENTIALS |
It was tried to authenticate the token, but the credentials were wrong. |
AUTHENTICATION_SUCCESSFUL |
The token has been successfully authenticated. |
AUTHENTICATION_NEEDED |
This indicates, that the token received credentials, but has not been authenticated yet. |
Methods
Returns the name of the authentication provider responsible for this token
Sets the name of the authentication provider responsible for this token
Returns true if this token is currently authenticated
Sets the authentication status. Usually called by the responsible AuthenticationManagerInterface
Returns the current authentication status
Returns the configured authentication entry point, NULL if none is available
Returns true if \Neos\Flow\Security\RequestPattern were set
Sets request patterns
Returns an array of set \Neos\Flow\Security\RequestPatternInterface, NULL if none was set
Updates the authentication credentials, the authentication manager needs to authenticate this token.
Returns the credentials of this token. The type depends on the provider of the token.
Returns the account if one is authenticated, NULL otherwise.
Returns a string representation of the token for logging purposes.
Details
string
getAuthenticationProviderName()
Returns the name of the authentication provider responsible for this token
void
setAuthenticationProviderName(string $authenticationProviderName)
Sets the name of the authentication provider responsible for this token
bool
isAuthenticated()
Returns true if this token is currently authenticated
void
setAuthenticationStatus(int $authenticationStatus)
Sets the authentication status. Usually called by the responsible AuthenticationManagerInterface
int
getAuthenticationStatus()
Returns the current authentication status
void
setAuthenticationEntryPoint(EntryPointInterface $entryPoint)
Sets the authentication entry point
EntryPointInterface
getAuthenticationEntryPoint()
Returns the configured authentication entry point, NULL if none is available
bool
hasRequestPatterns()
Returns true if \Neos\Flow\Security\RequestPattern were set
void
setRequestPatterns(array $requestPatterns)
Sets request patterns
RequestPatternInterface[]
getRequestPatterns()
Returns an array of set \Neos\Flow\Security\RequestPatternInterface, NULL if none was set
void
updateCredentials(ActionRequest $actionRequest)
Updates the authentication credentials, the authentication manager needs to authenticate this token.
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!
mixed
getCredentials()
Returns the credentials of this token. The type depends on the provider of the token.
Account
getAccount()
Returns the account if one is authenticated, NULL otherwise.
void
setAccount(Account $account = null)
Set the (authenticated) account
string
__toString()
Returns a string representation of the token for logging purposes.