PHP Interface Webiny\Component\Security\Token\TokenStorageInterface

Show file Open project: Webiny/Framework

Public Methods

Method Description
deleteUserToken ( ) : boolean Deletes the current auth token.
getTokenString ( ) : string Get token string representation
loadUserFromToken ( ) : boolean | AbstractUser Check if auth token is present, if true, try to load the right user and return it's username.
saveUserToken ( AbstractUser $user ) : boolean Save user authentication token.
setSecurityKey ( string $securityKey ) Sets the security key that will be used for encryption of token data.
setTokenName ( string $tokenName ) This function provides the token name to the storage.
setTokenRememberMe ( boolean $rememberMe ) This function provides the token 'remember me' flag to the storage.
setTokenString ( string $token ) Save the provided token string into the token storage.

Method Details

deleteUserToken() public method

Deletes the current auth token.
public deleteUserToken ( ) : boolean
return boolean

getTokenString() public method

Get token string representation
public getTokenString ( ) : string
return string

loadUserFromToken() public method

Check if auth token is present, if true, try to load the right user and return it's username.
public loadUserFromToken ( ) : boolean | AbstractUser
return boolean | Webiny\Component\Security\User\AbstractUser False it user token is not available, otherwise the AbstractUser object is returned.

saveUserToken() public method

Save user authentication token.
public saveUserToken ( AbstractUser $user ) : boolean
$user Webiny\Component\Security\User\AbstractUser Instance of AbstractUser class that holds the pre-filled object from user provider.
return boolean

setSecurityKey() public method

Sets the security key that will be used for encryption of token data.
public setSecurityKey ( string $securityKey )
$securityKey string Must have 16/32/64 chars.

setTokenName() public method

This function provides the token name to the storage.
public setTokenName ( string $tokenName )
$tokenName string Token name.

setTokenRememberMe() public method

This function provides the token 'remember me' flag to the storage.
public setTokenRememberMe ( boolean $rememberMe )
$rememberMe boolean Token rememberme.

setTokenString() public method

Save the provided token string into the token storage.
public setTokenString ( string $token )
$token string Token string to save.