Interface PrincipalAuthentication

All Superinterfaces:
Authentication
All Known Subinterfaces:
LDAPAuthentication, UserAuthentication<A>

public interface PrincipalAuthentication extends Authentication

An authentication resulting from the authentication of a principal entity uniquely identified by a username.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • getUsername

      String getUsername()

      Returns the unique username of the authenticated entity.

      Returns:
      a username
    • of

      static PrincipalAuthentication of(String username)

      Returns a new authenticated principal authentication for the specified username.

      This is a conveninence method that should be used with care and only used after a successful authentication to generate the resulting authentication.

      Parameters:
      username - a username
      Returns:
      a new principal authentication
    • of

      static PrincipalAuthentication of(String username, SecurityException cause)

      Returns a new denied principal authentication for the specified username and cause.

      Parameters:
      username - a username
      cause - the cause of the failed authentication
      Returns:
      a denied principal authentication
    • of

      Returns a new principal authentication from the specified credentials.

      This is a conveninence method that should be used with care. In order to respect the Authentication contract it is important to make sure that the specified credentials have been previously authenticated by an Authenticator.

      The resulting authentication is authenticated if the specified credentials are not locked.

      Parameters:
      credentials - authenticated credentials
      Returns:
      a new principal authentication