AbstractAuthenticationStrategy

Abstract base implementation for Shiro's concrete <code>AuthenticationStrategy</code> implementations.

Members

Functions

afterAllAttempts
AuthenticationInfo afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)

Simply returns the <code>aggregate</code> argument without modification. Can be overridden for custom behavior.

afterAttempt
AuthenticationInfo afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t)

Base implementation that will aggregate the specified <code>singleRealmInfo</code> into the <code>aggregateInfo</code> and then returns the aggregate. Can be overridden by subclasses for custom behavior.

beforeAllAttempts
AuthenticationInfo beforeAllAttempts(Realm[] realms, AuthenticationToken token)

Simply returns <code>new {@link hunt.shiro.authc.SimpleAuthenticationInfo SimpleAuthenticationInfo}();</code>, which supports aggregating account data across realms.

beforeAttempt
AuthenticationInfo beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)

Simply returns the <code>aggregate</code> method argument, without modification.

merge
AuthenticationInfo merge(AuthenticationInfo info, AuthenticationInfo aggregate)

Merges the specified <code>info</code> argument into the <code>aggregate</code> argument and then returns an aggregate for continued use throughout the login process. <p/> This implementation merely checks to see if the specified <code>aggregate</code> argument is an instance of {@link hunt.shiro.authc.MergableAuthenticationInfo MergableAuthenticationInfo}, and if so, calls <code>aggregate.merge(info)</code> If it is <em>not</em> an instance of <code>MergableAuthenticationInfo</code>, an {@link IllegalArgumentException IllegalArgumentException} is thrown. Can be overridden by subclasses for custom merging behavior if implementing the {@link hunt.shiro.authc.MergableAuthenticationInfo MergableAuthenticationInfo} is not desired for some reason.

Inherited Members

From AuthenticationStrategy

beforeAllAttempts
AuthenticationInfo beforeAllAttempts(Realm[] realms, AuthenticationToken token)

Method invoked by the ModularAuthenticator signifying that the authentication process is about to begin for the specified {@code token} - called before any {@code Realm} is actually invoked.

beforeAttempt
AuthenticationInfo beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)

Method invoked by the ModularAuthenticator just prior to the realm being consulted for account data, allowing pre-authentication-attempt logic for that realm only.

afterAttempt
AuthenticationInfo afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t)

Method invoked by the ModularAuthenticator just after the given realm has been consulted for authentication, allowing post-authentication-attempt logic for that realm only.

afterAllAttempts
AuthenticationInfo afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)

Method invoked by the ModularAuthenticator signifying that all of its configured Realms have been consulted for account data, allowing post-processing after all realms have completed.

Meta