Interface IAuthCredentialToSubjectResolverSPI


  • @IsSPIInterface
    public interface IAuthCredentialToSubjectResolverSPI
    This interface needs to be implemented by all classes that are used for resolving credentials to a certain subject.
    Author:
    Philip Helger
    • Method Detail

      • supportsCredentials

        boolean supportsCredentials​(@Nonnull
                                    IAuthCredentials aCredentials)
        Check if this class can handle the passed credential implementation.
        Parameters:
        aCredentials - The credentials to be validated. Never null.
        Returns:
        true if this class can handle the given credentials, false otherwise.
      • getSubjectFromCredentials

        @Nullable
        IAuthSubject getSubjectFromCredentials​(@Nonnull
                                               IAuthCredentials aCredentials)
        This method is only called if supportsCredentials(IAuthCredentials) returned true. It should try to resolve the credentials to an IAuthSubject. If resolving fails, no exception should be thrown, but null should be returned.
        Parameters:
        aCredentials - The credentials to be resolved to a subject. Never null .
        Returns:
        null if the credentials could not be resolved, the subject otherwise.