Module io.inverno.mod.security
Class GenericAuthentication
java.lang.Object
io.inverno.mod.security.internal.authentication.GenericAuthentication
- All Implemented Interfaces:
Authentication
Generic Authentication implementation.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GenericAuthenticationThe anonymous authentication (unauthenticated with no cause of authentication failure).static final GenericAuthenticationThe denied authentication.static final GenericAuthenticationThe granted authentication. -
Constructor Summary
ConstructorsConstructorDescriptionGenericAuthentication(boolean authenticated) Creates a generic authentication.Creates an unauthenticated authentication with the specified cause of authentication failure. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.inverno.mod.security.authentication.Authentication
isAnonymous
-
Field Details
-
ANONYMOUS
The anonymous authentication (unauthenticated with no cause of authentication failure). -
GRANTED
The granted authentication. -
DENIED
The denied authentication.
-
-
Constructor Details
-
GenericAuthentication
public GenericAuthentication(boolean authenticated) Creates a generic authentication.
- Parameters:
authenticated- true to create an authenticated authentication, false otherwise
-
GenericAuthentication
Creates an unauthenticated authentication with the specified cause of authentication failure.
- Parameters:
cause- the cause of the failed authentication
-
-
Method Details
-
isAuthenticated
public boolean isAuthenticated()Description copied from interface:AuthenticationDetermine whether the authentication is authenticated.
A non-authenticated authentication might indicates that no authentication took place (i.e. anonymous access) or that the authentication failed. In case of a failed authentication, the cause is exposed by
Authentication.getCause().- Specified by:
isAuthenticatedin interfaceAuthentication- Returns:
- true if the the authentication is authenticated, false otherwise
-
getCause
Description copied from interface:AuthenticationReturns the cause of a failed authentication.
A non-authenticated authentication with no cause indicates that no authentication took place (i.e. anonymous access).
A non-authenticated authentication with a cause indicates a failed authentication.
- Specified by:
getCausein interfaceAuthentication- Returns:
- an optional returning the cause of the failed authentication, or an empty optional if there was no authentication or if the authentication was successful
-
hashCode
public int hashCode() -
equals
-