|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shiro.authc.pam.AbstractAuthenticationStrategy
public abstract class AbstractAuthenticationStrategy
Abstract base implementation for Shiro's concrete AuthenticationStrategy
implementations.
Constructor Summary | |
---|---|
AbstractAuthenticationStrategy()
|
Method Summary | |
---|---|
AuthenticationInfo |
afterAllAttempts(AuthenticationToken token,
AuthenticationInfo aggregate)
Simply returns the aggregate argument without modification. |
AuthenticationInfo |
afterAttempt(Realm realm,
AuthenticationToken token,
AuthenticationInfo singleRealmInfo,
AuthenticationInfo aggregateInfo,
Throwable t)
Base implementation that will aggregate the specified singleRealmInfo into the
aggregateInfo and then returns the aggregate. |
AuthenticationInfo |
beforeAllAttempts(Collection<? extends Realm> realms,
AuthenticationToken token)
Simply returns new , which supports
aggregating account data across realms. |
AuthenticationInfo |
beforeAttempt(Realm realm,
AuthenticationToken token,
AuthenticationInfo aggregate)
Simply returns the aggregate method argument, without modification. |
protected AuthenticationInfo |
merge(AuthenticationInfo info,
AuthenticationInfo aggregate)
Merges the specified info argument into the aggregate argument and then returns an
aggregate for continued use throughout the login process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAuthenticationStrategy()
Method Detail |
---|
public AuthenticationInfo beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token) throws AuthenticationException
new SimpleAuthenticationInfo
();
, which supports
aggregating account data across realms.
beforeAllAttempts
in interface AuthenticationStrategy
realms
- the Realms that will be consulted during the authentication process for the specified token.token
- the Principal/Credential representation to be used during authentication for a corresponding subject.
AuthenticationException
- if the strategy implementation does not wish the Authentication attempt to execute.public AuthenticationInfo beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate) throws AuthenticationException
aggregate
method argument, without modification.
beforeAttempt
in interface AuthenticationStrategy
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
aggregate
method argument is the normal case if no special action needs to be taken.
AuthenticationException
- an exception thrown by the Strategy implementation if it wishes the login
process for the associated subject (user) to stop immediately.public AuthenticationInfo afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t) throws AuthenticationException
singleRealmInfo
into the
aggregateInfo
and then returns the aggregate. Can be overridden by subclasses for custom behavior.
afterAttempt
in interface AuthenticationStrategy
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.
aggregateAccount
method argument is the normal case if no special action needs to be taken.
AuthenticationException
- an exception thrown by the Strategy implementation if it wishes the login process
for the associated subject (user) to stop immediately.protected AuthenticationInfo merge(AuthenticationInfo info, AuthenticationInfo aggregate)
info
argument into the aggregate
argument and then returns an
aggregate for continued use throughout the login process.
This implementation merely checks to see if the specified aggregate
argument is an instance of
MergableAuthenticationInfo
, and if so, calls
aggregate.merge(info)
If it is not an instance of
MergableAuthenticationInfo
, an IllegalArgumentException
is thrown.
Can be overridden by subclasses for custom merging behavior if implementing the
MergableAuthenticationInfo
is not desired for some reason.
public AuthenticationInfo afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate) throws AuthenticationException
aggregate
argument without modification. Can be overridden for custom behavior.
afterAllAttempts
in interface AuthenticationStrategy
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.
AuthenticationInfo
object to return to the Authenticator.authenticate() caller.
AuthenticationException
- if the Strategy implementation wishes to fail the authentication attempt.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |