Class AuthenticationResult


  • public class AuthenticationResult
    extends java.lang.Object
    Encapsulates the result of an attempt to authenticate using an AuthenticationProvider.

    The authentication status describes the overall outcome.

    1. If authentication status is SUCCESS, at least one Principal will be populated.
    2. If authentication status is CONTINUE, the authentication has failed because the user supplied incorrect credentials (etc). If the authentication requires it, the next challenge is made available.
    3. If authentication status is ERROR , the authentication decision could not be made due to a failure (such as an external system), the getCause() will provide the underlying exception.
    The main principal provided to the constructor is wrapped in an AuthenticatedPrincipal to make it easier for the rest of the application to identify it among the set of other principals.
    • Constructor Detail

      • AuthenticationResult

        public AuthenticationResult​(java.security.Principal mainPrincipal)
      • AuthenticationResult

        public AuthenticationResult​(java.security.Principal mainPrincipal,
                                    byte[] challenge)
      • AuthenticationResult

        public AuthenticationResult​(java.security.Principal mainPrincipal,
                                    java.util.Set<java.security.Principal> otherPrincipals,
                                    byte[] challenge)
    • Method Detail

      • getCause

        public java.lang.Exception getCause()
      • getChallenge

        public byte[] getChallenge()
      • getPrincipals

        public java.util.Set<java.security.Principal> getPrincipals()
      • getMainPrincipal

        public java.security.Principal getMainPrincipal()