Module io.inverno.mod.security
Interface CredentialsMatcher<A extends Credentials,B extends Credentials>
- Type Parameters:
A
- the type of the credentialsB
- the type of the other credentials
- All Known Implementing Classes:
DigestCredentialsMatcher
,LoginCredentialsMatcher
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface CredentialsMatcher<A extends Credentials,B extends Credentials>
A credentials matcher can be used during an authentication to match two credentials, typically the one provided by the entity to authenticated and the one resolved from a trusted authority or repository.
an Authenticator
implemention can typically relies on a credentials matcher to determine whether the credentials provided by an entity are matching the credentials obtained from a trusted
source (i.e. a trusted repository, a trusted directory service...).
- Since:
- 1.5
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
-
Method Details
-
matches
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.- 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:
-