Interface CredentialsMatcher<A extends Credentials,
B extends Credentials>
- Type Parameters:
A- the type of the credentials
B- the type of the other credentials
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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.
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...).
Determines whether the two specified credentials are matching.
This method must be:
matches(credentials, credentials)should return
- symetric: if
matches(credentials2, credentials1)) should also return
- transitive: if
matches(credentials2, credentials3)returns true then
matches(credentials1, credentials3)should also return
However this method does not have to be consistent: multiple invocations of
matches(credentials1, credentials2)are not guaranteed to always return the same result.
credentials- the credentials
otherCredentials- the other credentials
- true if the credentials matches the other credentials, false otherwise
SecurityException- if there was an error matching credentials