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 credentials
B - 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 Details

    • LoginCredentialsMatcher

      public LoginCredentialsMatcher()
  • Method Details

    • matches

      public boolean matches(A credentials, B otherCredentials) throws SecurityException
      Description copied from interface: CredentialsMatcher

      Determines whether the two specified credentials are matching.

      This method must be:

      • reflexive: matches(credentials, credentials) should return true
      • symetric: if matches(credentials1, credentials2) returns true (matches(credentials2, credentials1)) should also return true
      • transitive: if matches(credentials1, credentials2) returns true and matches(credentials2, credentials3) returns true then matches(credentials1, credentials3) should also return true

      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 interface CredentialsMatcher<A extends LoginCredentials,B extends LoginCredentials>
      Parameters:
      credentials - the credentials
      otherCredentials - the other credentials
      Returns:
      true if the credentials matches the other credentials, false otherwise
      Throws:
      SecurityException - if there was an error matching credentials