Interface PrincipalAuthentication
- All Superinterfaces:
Authentication
- All Known Subinterfaces:
LDAPAuthentication,UserAuthentication<A>
An authentication resulting from the authentication of a principal entity uniquely identified by a username.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionReturns the unique username of the authenticated entity.static PrincipalAuthenticationof(PrincipalCredentials credentials) Returns a new principal authentication from the specified credentials.static PrincipalAuthenticationReturns a new authenticated principal authentication for the specified username.static PrincipalAuthenticationof(String username, SecurityException cause) Returns a new denied principal authentication for the specified username and cause.Methods inherited from interface io.inverno.mod.security.authentication.Authentication
getCause, isAnonymous, isAuthenticated
-
Method Details
-
getUsername
String getUsername()Returns the unique username of the authenticated entity.
- Returns:
- a username
-
of
Returns a new authenticated principal authentication for the specified username.
This is a convenience method that should be used with care and only used after a successful authentication to generate the resulting authentication.
- Parameters:
username- a username- Returns:
- a new principal authentication
-
of
Returns a new denied principal authentication for the specified username and cause.
- Parameters:
username- a usernamecause- the cause of the failed authentication- Returns:
- a denied principal authentication
-
of
Returns a new principal authentication from the specified credentials.
This is a convenience method that should be used with care. In order to respect the
Authenticationcontract it is important to make sure that the specified credentials have been previously authenticated by anAuthenticator.The resulting authentication is authenticated if the specified credentials are not locked.
- Parameters:
credentials- authenticated credentials- Returns:
- a new principal authentication
-