Module io.inverno.mod.security
Class LoginCredentialsMatcher<A extends LoginCredentials,B extends LoginCredentials>
java.lang.Object
io.inverno.mod.security.authentication.LoginCredentialsMatcher<A,B>
- Type Parameters:
A
- the type of the first login credentialsB
- the type of the seconde login credentials
- All Implemented Interfaces:
CredentialsMatcher<A,
B>
public class LoginCredentialsMatcher<A extends LoginCredentials,B extends LoginCredentials>
extends Object
implements CredentialsMatcher<A,B>
A login credentials matcher is used to verify that two login credentials are matching.
Two login credentials are matching if an only if they are defined for the same username and their password are matching.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
LoginCredentialsMatcher
public LoginCredentialsMatcher()
-
-
Method Details
-
matches
Description copied from interface:CredentialsMatcher
Determines whether the two specified credentials are matching.
This method must be:
- reflexive:
matches(credentials, credentials)
should returntrue
- symetric: if
matches(credentials1, credentials2)
returnstrue
(matches(credentials2, credentials1)
) should also returntrue
- transitive: if
matches(credentials1, credentials2)
returnstrue
andmatches(credentials2, credentials3)
returns true thenmatches(credentials1, credentials3)
should also returntrue
However this method does not have to be consistent: multiple invocations of
matches(credentials1, credentials2)
are not guaranteed to always return the same result.- Specified by:
matches
in interfaceCredentialsMatcher<A extends LoginCredentials,
B extends LoginCredentials> - Parameters:
credentials
- the credentialsotherCredentials
- the other credentials- Returns:
- true if the credentials matches the other credentials, false otherwise
- Throws:
SecurityException
- if there was an error matching credentials
- reflexive:
-