Module io.inverno.mod.security
Class InMemoryLoginCredentialsResolver
java.lang.Object
io.inverno.mod.security.authentication.InMemoryLoginCredentialsResolver
- All Implemented Interfaces:
CredentialsResolver<LoginCredentials>
public class InMemoryLoginCredentialsResolver
extends Object
implements CredentialsResolver<LoginCredentials>
A simple login credentials resolver that stores credentials in memory.
This is a convenient implementation that should not be used to create properly secured applications.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Constructor Summary
ConstructorDescriptionCreates an empty login credentials resolver.InMemoryLoginCredentialsResolver
(List<LoginCredentials> credentials) Creates a login credentials resolver initialized with the specified list of credentials. -
Method Summary
Modifier and TypeMethodDescriptionvoid
put
(LoginCredentials credentials) Adds/Sets the specified login credentials.void
Adds/Sets the login credentials identified by the secified username.Removes the login credentials identified by the specified username.Returns trusted credentials for the specified identifier.
-
Constructor Details
-
InMemoryLoginCredentialsResolver
public InMemoryLoginCredentialsResolver()Creates an empty login credentials resolver.
-
InMemoryLoginCredentialsResolver
Creates a login credentials resolver initialized with the specified list of credentials.
- Parameters:
credentials
- a list of credentials
-
-
Method Details
-
put
Adds/Sets the login credentials identified by the secified username.
- Parameters:
username
- a usernamepassword
- a password
-
put
Adds/Sets the specified login credentials.
- Parameters:
credentials
- login credentials
-
remove
Removes the login credentials identified by the specified username.
- Parameters:
username
- a username- Returns:
- the removed credentials or null if no credentials were removed
-
resolveCredentials
Description copied from interface:CredentialsResolver
Returns trusted credentials for the specified identifier.
- Specified by:
resolveCredentials
in interfaceCredentialsResolver<LoginCredentials>
- Parameters:
id
- the identifier of the credentials to resolve- Returns:
- a mono emitting the credentials or an empty mono if no credentials exist with the specified identifier
- Throws:
AuthenticationException
-