Class AuthenticationFailed
- java.lang.Object
-
- io.micronaut.security.authentication.AuthenticationFailed
-
- All Implemented Interfaces:
AuthenticationResponse
,java.io.Serializable
public class AuthenticationFailed extends java.lang.Object implements AuthenticationResponse
Signalises an authentication failure and stores the failure reason.- Since:
- 1.0
- Author:
- Sergio del Amo
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AuthenticationFailed()
Necessary for JSON Serialization.AuthenticationFailed(AuthenticationFailureReason authenticationFailure)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
createMessage(AuthenticationFailureReason authenticationFailure)
Generates a Title Case string for give authentication Failure.boolean
equals(java.lang.Object o)
java.util.Optional<java.lang.String>
getMessage()
message getter.AuthenticationFailureReason
getReason()
int
hashCode()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.security.authentication.AuthenticationResponse
isAuthenticated
-
-
-
-
Constructor Detail
-
AuthenticationFailed
public AuthenticationFailed()
Necessary for JSON Serialization.
-
AuthenticationFailed
public AuthenticationFailed(AuthenticationFailureReason authenticationFailure)
- Parameters:
authenticationFailure
- AuthenticationFailure enum which represents the failure reason
-
-
Method Detail
-
createMessage
protected java.lang.String createMessage(AuthenticationFailureReason authenticationFailure)
Generates a Title Case string for give authentication Failure.- Parameters:
authenticationFailure
- the authentication failure- Returns:
- the Title Case String
-
getMessage
public java.util.Optional<java.lang.String> getMessage()
message getter.- Specified by:
getMessage
in interfaceAuthenticationResponse
- Returns:
- Failure message
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getReason
public AuthenticationFailureReason getReason()
- Returns:
- The reason why authentication failed.
-
-