CustomUserMessageAuthenticationException
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
TokenInterface | getToken() Get the token. | from AuthenticationException |
setToken(TokenInterface $token) | from AuthenticationException | |
serialize() | ||
unserialize($str) | ||
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 = array(), int $code, Exception $previous = null) | ||
setSafeMessage(string $messageKey, array $messageData = array()) 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()
unserialize($str)
Parameters
$str |
string getMessageKey()
Message key to be used by the translation component.
Return Value
string |
array getMessageData()
Message data to be used by the translation component.
Return Value
array |
__construct(string $message = '', array $messageData = array(), int $code, Exception $previous = null)
Parameters
string | $message | |
array | $messageData | |
int | $code | |
Exception | $previous |
setSafeMessage(string $messageKey, array $messageData = array())
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 |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Security/Core/Exception/CustomUserMessageAuthenticationException.html