class CustomUserMessageAuthenticationException extends AuthenticationException

An authentication exception where you can control the message shown to the user.

Be sure that the message passed to this exception is something that can be shown safely to your user. In other words, avoid catching other exceptions and passing their message directly to this class.

Methods

setToken(TokenInterface $token)

No description

serialize()

{@inheritdoc}

unserialize($serialized)

{@inheritdoc}

array
getState()

Returns all the necessary state of the object for serialization purposes.

setState(array $data)

Restores the object state from an array given by getState().

doSerialize($serialized, $isCalledFromOverridingMethod)

No description

string
getMessageKey()

Message key to be used by the translation component.

array
getMessageData()

Message data to be used by the translation component.

__construct(string $message = '', array $messageData = [], int $code = 0, Exception $previous = null)

No description

setSafeMessage(string $messageKey, array $messageData = [])

Set a message that will be shown to the user.

Details

TokenInterface getToken()

Get the token.

Return Value

TokenInterface

setToken(TokenInterface $token)

Parameters

TokenInterface $token

serialize()

{@inheritdoc}

unserialize($serialized)

{@inheritdoc}

Parameters

$serialized

at line 61
protected array getState()

Returns all the necessary state of the object for serialization purposes.

There is no need to serialize any entry, they should be returned as-is. If you extend this method, keep in mind you MUST guarantee parent data is present in the state. Here is an example of how to extend this method: protected function getState(): array { return [$this->childAttribute, parent::getState()]; }

Return Value

array

at line 69
protected setState(array $data)

Restores the object state from an array given by getState().

There is no need to unserialize any entry in $data, they are already ready-to-use. If you extend this method, keep in mind you MUST pass the parent data to its respective class. Here is an example of how to extend this method: protected function setState(array $data) { [$this->childAttribute, $parentData] = $data; parent::setState($parentData); }

Parameters

array $data

protected doSerialize($serialized, $isCalledFromOverridingMethod)

Parameters

$serialized
$isCalledFromOverridingMethod

at line 48
string getMessageKey()

Message key to be used by the translation component.

Return Value

string

at line 53
array getMessageData()

Message data to be used by the translation component.

Return Value

array

at line 29
__construct(string $message = '', array $messageData = [], int $code = 0, Exception $previous = null)

Parameters

string $message
array $messageData
int $code
Exception $previous

at line 42
setSafeMessage(string $messageKey, array $messageData = [])

Set a message that will be shown to the user.

Parameters

string $messageKey The message or message key
array $messageData Data to be passed into the translator