Class AbstractAuthenticationStrategy

    • Constructor Detail

      • AbstractAuthenticationStrategy

        public AbstractAuthenticationStrategy()
    • Method Detail

      • beforeAttempt

        public AuthenticationInfo beforeAttempt(Realm realm,
                                                AuthenticationToken token,
                                                AuthenticationInfo aggregate)
                                         throws AuthenticationException
        Simply returns the aggregate method argument, without modification.
        Specified by:
        beforeAttempt in interface AuthenticationStrategy
        Parameters:
        realm - the realm that will be consulted for AuthenticationInfo for the specified token.
        token - the AuthenticationToken submitted for the subject attempting system log-in.
        aggregate - the aggregated AuthenticationInfo object being used across the multi-realm authentication attempt
        Returns:
        the AuthenticationInfo object that will be presented to further realms in the authentication process - returning the aggregate method argument is the normal case if no special action needs to be taken.
        Throws:
        AuthenticationException - an exception thrown by the Strategy implementation if it wishes the login process for the associated subject (user) to stop immediately.
      • afterAttempt

        public AuthenticationInfo afterAttempt(Realm realm,
                                               AuthenticationToken token,
                                               AuthenticationInfo singleRealmInfo,
                                               AuthenticationInfo aggregateInfo,
                                               Throwable t)
                                        throws AuthenticationException
        Base implementation that will aggregate the specified singleRealmInfo into the aggregateInfo and then returns the aggregate. Can be overridden by subclasses for custom behavior.
        Specified by:
        afterAttempt in interface AuthenticationStrategy
        Parameters:
        realm - the realm that was just consulted for AuthenticationInfo for the given token.
        token - the AuthenticationToken submitted for the subject attempting system log-in.
        singleRealmInfo - the info returned from a single realm.
        aggregateInfo - the aggregate info representing all realms in a multi-realm environment.
        t - the Throwable thrown by the Realm during the attempt, or null if the method returned normally.
        Returns:
        the AuthenticationInfo object that will be presented to further realms in the authentication process - returning the aggregateAccount method argument is the normal case if no special action needs to be taken.
        Throws:
        AuthenticationException - an exception thrown by the Strategy implementation if it wishes the login process for the associated subject (user) to stop immediately.
      • afterAllAttempts

        public AuthenticationInfo afterAllAttempts(AuthenticationToken token,
                                                   AuthenticationInfo aggregate)
                                            throws AuthenticationException
        Simply returns the aggregate argument without modification. Can be overridden for custom behavior.
        Specified by:
        afterAllAttempts in interface AuthenticationStrategy
        Parameters:
        token - the AuthenticationToken submitted for the subject attempting system log-in.
        aggregate - the aggregate AuthenticationInfo instance populated by all realms during the log-in attempt.
        Returns:
        the final AuthenticationInfo object to return to the Authenticator.authenticate() caller.
        Throws:
        AuthenticationException - if the Strategy implementation wishes to fail the authentication attempt.