Uses of Interface
org.apache.shiro.authc.AuthenticationInfo
-
Packages that use AuthenticationInfo Package Description org.apache.shiro.authc Core interfaces and exceptions concerning Authentication (the act of logging-in).org.apache.shiro.authc.credential Support for validating credentials (such as passwords or X509 certificates) during authentication via theCredentialsMatcher
interface and its supporting implementations.org.apache.shiro.authc.pam Support for PAM, or Pluggable Authentication Modules, which is the capability to authenticate a user against multiple configurable (pluggable) modules (Shiro calls theseRealm
s).org.apache.shiro.mgt Provides the masterSecurityManager
interface and a default implementation hierarchy for managing all aspects of Shiro's functionality in an application.org.apache.shiro.realm Components and sub-packages used in supporting the coreRealm
interface.org.apache.shiro.realm.activedirectory Realms that acquire security data from a Microsoft Active Directory.org.apache.shiro.realm.jdbc Realms that acquire security data from an RDBMS (Relational Database Management System) using the JDBC API.org.apache.shiro.realm.ldap Realms that acquire security data from an LDAP (Lightweight Directory Access Protocol) server utilizing LDAP/Naming APIs.org.apache.shiro.subject Components supporting theSubject
interface, the most important concept in Shiro's API.org.apache.shiro.subject.support Concrete support implementations of most of theorg.apache.shiro.subject
interfaces. -
-
Uses of AuthenticationInfo in org.apache.shiro.authc
Subinterfaces of AuthenticationInfo in org.apache.shiro.authc Modifier and Type Interface Description interface
Account
An Account is a convenience interface that extends bothAuthenticationInfo
andAuthorizationInfo
and represents authentication and authorization for a single account in a single Realm.interface
MergableAuthenticationInfo
An extension of theAuthenticationInfo
interface to be implemented by classes that support merging with otherAuthenticationInfo
instances.interface
SaltedAuthenticationInfo
Interface representing account information that may use a salt when hashing credentials.Classes in org.apache.shiro.authc that implement AuthenticationInfo Modifier and Type Class Description class
SimpleAccount
Simple implementation of theAccount
interface that contains principal and credential and authorization information (roles and permissions) as instance variables and exposes them via getters and setters using standard JavaBean notation.class
SimpleAuthenticationInfo
Simple implementation of theMergableAuthenticationInfo
interface that holds the principals and credentials.Methods in org.apache.shiro.authc that return AuthenticationInfo Modifier and Type Method Description AuthenticationInfo
AbstractAuthenticator. authenticate(AuthenticationToken token)
Implementation of theAuthenticator
interface that functions in the following manner: Calls templatedoAuthenticate
method for subclass execution of the actual authentication behavior. If anAuthenticationException
is thrown duringdoAuthenticate
,notify
any registeredAuthenticationListener
s of the exception and then propagate the exception for the caller to handle. If no exception is thrown (indicating a successful login),notify
any registeredAuthenticationListener
s of the successful attempt. Return theAuthenticationInfo
AuthenticationInfo
Authenticator. authenticate(AuthenticationToken authenticationToken)
Authenticates a user based on the submittedAuthenticationToken
.protected abstract AuthenticationInfo
AbstractAuthenticator. doAuthenticate(AuthenticationToken token)
Template design pattern hook for subclasses to implement specific authentication behavior.Methods in org.apache.shiro.authc with parameters of type AuthenticationInfo Modifier and Type Method Description void
MergableAuthenticationInfo. merge(AuthenticationInfo info)
Merges the givenAuthenticationInfo
into this instance.void
SimpleAccount. merge(AuthenticationInfo info)
Merges the specifiedAuthenticationInfo
into thisAccount
.void
SimpleAuthenticationInfo. merge(AuthenticationInfo info)
Takes the specifiedinfo
argument and adds its principals and credentials into this instance.protected void
AbstractAuthenticator. notifySuccess(AuthenticationToken token, AuthenticationInfo info)
Notifies any registeredAuthenticationListener
s that authentication was successful for the specifiedtoken
which resulted in the specifiedinfo
.void
AuthenticationListener. onSuccess(AuthenticationToken token, AuthenticationInfo info)
Callback triggered when an authentication attempt for aSubject
has succeeded. -
Uses of AuthenticationInfo in org.apache.shiro.authc.credential
Methods in org.apache.shiro.authc.credential with parameters of type AuthenticationInfo Modifier and Type Method Description boolean
AllowAllCredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
Returnstrue
always no matter what the method arguments are.boolean
CredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
Returnstrue
if the provided token credentials match the stored account credentials,false
otherwise.boolean
HashedCredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
This implementation first hashes thetoken
's credentials, potentially using asalt
if theinfo
argument is aSaltedAuthenticationInfo
.boolean
PasswordMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
boolean
SimpleCredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
This implementation acquires thetoken
's credentials (viagetCredentials(token)
) and then theaccount
's credentials (viagetCredentials(account)
) and then passes both of them to theequals(tokenCredentials, accountCredentials)
method for equality comparison.protected Object
HashedCredentialsMatcher. getCredentials(AuthenticationInfo info)
Returns aHash
instance representing the already-hashed AuthenticationInfo credentials stored in the system.protected Object
SimpleCredentialsMatcher. getCredentials(AuthenticationInfo info)
Returns theaccount
's credentials.protected Object
PasswordMatcher. getStoredPassword(AuthenticationInfo storedAccountInfo)
protected Object
HashedCredentialsMatcher. hashProvidedCredentials(AuthenticationToken token, AuthenticationInfo info)
Hash the providedtoken
's credentials using the salt stored with the account if theinfo
instance is aninstanceof
SaltedAuthenticationInfo
(see the class-level JavaDoc for why this is the preferred approach). -
Uses of AuthenticationInfo in org.apache.shiro.authc.pam
Methods in org.apache.shiro.authc.pam that return AuthenticationInfo Modifier and Type Method Description AuthenticationInfo
AbstractAuthenticationStrategy. afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)
Simply returns theaggregate
argument without modification.AuthenticationInfo
AtLeastOneSuccessfulStrategy. afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)
Ensures that theaggregate
method argument is notnull
andaggregate.
is notgetPrincipals()
null
, and if either isnull
, throws an AuthenticationException to indicate that none of the realms authenticated successfully.AuthenticationInfo
AuthenticationStrategy. 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.AuthenticationInfo
AbstractAuthenticationStrategy. afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t)
Base implementation that will aggregate the specifiedsingleRealmInfo
into theaggregateInfo
and then returns the aggregate.AuthenticationInfo
AllSuccessfulStrategy. afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo info, AuthenticationInfo aggregate, Throwable t)
Merges the specifiedinfo
into theaggregate
argument and returns it (just as the parent implementation does), but additionally ensures the following: if theThrowable
argument is notnull
, re-throws it to immediately cancel the authentication process, since this strategy requires all realms to authenticate successfully. neither theinfo
oraggregate
argument isnull
to ensure that each realm did in fact authenticate successfullyAuthenticationInfo
AuthenticationStrategy. 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.AuthenticationInfo
AbstractAuthenticationStrategy. beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token)
Simply returnsnew
, which supports aggregating account data across realms.SimpleAuthenticationInfo
();AuthenticationInfo
AuthenticationStrategy. beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token)
Method invoked by the ModularAuthenticator signifying that the authentication process is about to begin for the specifiedtoken
- called before anyRealm
is actually invoked.AuthenticationInfo
FirstSuccessfulStrategy. beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token)
Returnsnull
immediately, relying on this class'smerge
implementation to return only the firstinfo
object it encounters, ignoring all subsequent ones.AuthenticationInfo
AbstractAuthenticationStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)
Simply returns theaggregate
method argument, without modification.AuthenticationInfo
AllSuccessfulStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo info)
Because all realms in this strategy must complete successfully, this implementation ensures that the givenRealm
supports
the giventoken
argument.AuthenticationInfo
AuthenticationStrategy. 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.AuthenticationInfo
FirstSuccessfulStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)
Throws ShortCircuitIterationException if stopAfterFirstSuccess is set and authentication is successful with a previously consulted realm.protected AuthenticationInfo
ModularRealmAuthenticator. doAuthenticate(AuthenticationToken authenticationToken)
Attempts to authenticate the given token by iterating over the internal collection ofRealm
s.protected AuthenticationInfo
ModularRealmAuthenticator. doMultiRealmAuthentication(Collection<Realm> realms, AuthenticationToken token)
Performs the multi-realm authentication attempt by calling back to aAuthenticationStrategy
object as each realm is consulted forAuthenticationInfo
for the specifiedtoken
.protected AuthenticationInfo
ModularRealmAuthenticator. doSingleRealmAuthentication(Realm realm, AuthenticationToken token)
Performs the authentication attempt by interacting with the single configured realm, which is significantly simpler than performing multi-realm logic.protected AuthenticationInfo
AbstractAuthenticationStrategy. merge(AuthenticationInfo info, AuthenticationInfo aggregate)
Merges the specifiedinfo
argument into theaggregate
argument and then returns an aggregate for continued use throughout the login process.protected AuthenticationInfo
FirstSuccessfulStrategy. merge(AuthenticationInfo info, AuthenticationInfo aggregate)
Returns the specifiedaggregate
instance if is non null and valid (that is, has principals and they are not empty) immediately, or, if it is null or not valid, theinfo
argument is returned instead.Methods in org.apache.shiro.authc.pam with parameters of type AuthenticationInfo Modifier and Type Method Description AuthenticationInfo
AbstractAuthenticationStrategy. afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)
Simply returns theaggregate
argument without modification.AuthenticationInfo
AtLeastOneSuccessfulStrategy. afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)
Ensures that theaggregate
method argument is notnull
andaggregate.
is notgetPrincipals()
null
, and if either isnull
, throws an AuthenticationException to indicate that none of the realms authenticated successfully.AuthenticationInfo
AuthenticationStrategy. 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.AuthenticationInfo
AbstractAuthenticationStrategy. afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t)
Base implementation that will aggregate the specifiedsingleRealmInfo
into theaggregateInfo
and then returns the aggregate.AuthenticationInfo
AllSuccessfulStrategy. afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo info, AuthenticationInfo aggregate, Throwable t)
Merges the specifiedinfo
into theaggregate
argument and returns it (just as the parent implementation does), but additionally ensures the following: if theThrowable
argument is notnull
, re-throws it to immediately cancel the authentication process, since this strategy requires all realms to authenticate successfully. neither theinfo
oraggregate
argument isnull
to ensure that each realm did in fact authenticate successfullyAuthenticationInfo
AuthenticationStrategy. 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.AuthenticationInfo
AbstractAuthenticationStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)
Simply returns theaggregate
method argument, without modification.AuthenticationInfo
AllSuccessfulStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo info)
Because all realms in this strategy must complete successfully, this implementation ensures that the givenRealm
supports
the giventoken
argument.AuthenticationInfo
AuthenticationStrategy. 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.AuthenticationInfo
FirstSuccessfulStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)
Throws ShortCircuitIterationException if stopAfterFirstSuccess is set and authentication is successful with a previously consulted realm.protected AuthenticationInfo
AbstractAuthenticationStrategy. merge(AuthenticationInfo info, AuthenticationInfo aggregate)
Merges the specifiedinfo
argument into theaggregate
argument and then returns an aggregate for continued use throughout the login process.protected AuthenticationInfo
FirstSuccessfulStrategy. merge(AuthenticationInfo info, AuthenticationInfo aggregate)
Returns the specifiedaggregate
instance if is non null and valid (that is, has principals and they are not empty) immediately, or, if it is null or not valid, theinfo
argument is returned instead. -
Uses of AuthenticationInfo in org.apache.shiro.mgt
Methods in org.apache.shiro.mgt that return AuthenticationInfo Modifier and Type Method Description AuthenticationInfo
AuthenticatingSecurityManager. authenticate(AuthenticationToken token)
Delegates to the wrappedAuthenticator
for authentication.Methods in org.apache.shiro.mgt with parameters of type AuthenticationInfo Modifier and Type Method Description protected Subject
DefaultSecurityManager. createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing)
Creates aSubject
instance for the user represented by the given method arguments.protected PrincipalCollection
AbstractRememberMeManager. getIdentityToRemember(Subject subject, AuthenticationInfo info)
void
AbstractRememberMeManager. onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info)
Reacts to the successful login attempt by first alwaysforgetting
any previously stored identity.protected void
DefaultSecurityManager. onSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject)
void
RememberMeManager. onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info)
Reacts to a successful authentication attempt, typically saving the principals to be retrieved ('remembered') for future system access.void
AbstractRememberMeManager. rememberIdentity(Subject subject, AuthenticationToken token, AuthenticationInfo authcInfo)
Remembers a subject-unique identity for retrieval later.protected void
DefaultSecurityManager. rememberMeSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject)
-
Uses of AuthenticationInfo in org.apache.shiro.realm
Methods in org.apache.shiro.realm that return AuthenticationInfo Modifier and Type Method Description protected abstract AuthenticationInfo
AuthenticatingRealm. doGetAuthenticationInfo(AuthenticationToken token)
Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for the given authentication token.protected AuthenticationInfo
SimpleAccountRealm. doGetAuthenticationInfo(AuthenticationToken token)
AuthenticationInfo
AuthenticatingRealm. getAuthenticationInfo(AuthenticationToken token)
This implementation functions as follows: It attempts to acquire any cachedAuthenticationInfo
corresponding to the specifiedAuthenticationToken
argument.AuthenticationInfo
Realm. getAuthenticationInfo(AuthenticationToken token)
Returns an account's authentication-specific information for the specified token, or null if no account could be found based on the token.Methods in org.apache.shiro.realm that return types with arguments of type AuthenticationInfo Modifier and Type Method Description org.apache.shiro.cache.Cache<Object,AuthenticationInfo>
AuthenticatingRealm. getAuthenticationCache()
Returns aCache
instance to use for authentication caching, ornull
if no cache has been set.Methods in org.apache.shiro.realm with parameters of type AuthenticationInfo Modifier and Type Method Description protected void
AuthenticatingRealm. assertCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
Asserts that the submittedAuthenticationToken
's credentials match the stored accountAuthenticationInfo
's credentials, and if not, throws anAuthenticationException
.protected boolean
AuthenticatingRealm. isAuthenticationCachingEnabled(AuthenticationToken token, AuthenticationInfo info)
Returnstrue
if authentication caching should be utilized based on the specifiedAuthenticationToken
and/orAuthenticationInfo
,false
otherwise.Method parameters in org.apache.shiro.realm with type arguments of type AuthenticationInfo Modifier and Type Method Description void
AuthenticatingRealm. setAuthenticationCache(org.apache.shiro.cache.Cache<Object,AuthenticationInfo> authenticationCache)
Sets an explicitCache
instance to use for authentication caching. -
Uses of AuthenticationInfo in org.apache.shiro.realm.activedirectory
Methods in org.apache.shiro.realm.activedirectory that return AuthenticationInfo Modifier and Type Method Description protected AuthenticationInfo
ActiveDirectoryRealm. buildAuthenticationInfo(String username, char[] password)
protected AuthenticationInfo
ActiveDirectoryRealm. queryForAuthenticationInfo(AuthenticationToken token, LdapContextFactory ldapContextFactory)
Builds anAuthenticationInfo
object by querying the active directory LDAP context for the specified username. -
Uses of AuthenticationInfo in org.apache.shiro.realm.jdbc
Methods in org.apache.shiro.realm.jdbc that return AuthenticationInfo Modifier and Type Method Description protected AuthenticationInfo
JdbcRealm. doGetAuthenticationInfo(AuthenticationToken token)
-
Uses of AuthenticationInfo in org.apache.shiro.realm.ldap
Methods in org.apache.shiro.realm.ldap that return AuthenticationInfo Modifier and Type Method Description protected AuthenticationInfo
DefaultLdapRealm. createAuthenticationInfo(AuthenticationToken token, Object ldapPrincipal, Object ldapCredentials, LdapContext ldapContext)
Returns theAuthenticationInfo
resulting from a Subject's successful LDAP authentication attempt.protected AuthenticationInfo
AbstractLdapRealm. doGetAuthenticationInfo(AuthenticationToken token)
protected AuthenticationInfo
DefaultLdapRealm. doGetAuthenticationInfo(AuthenticationToken token)
Delegates toDefaultLdapRealm.queryForAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken, LdapContextFactory)
, wrapping anyNamingException
s in a ShiroAuthenticationException
to satisfy the parent method signature.protected abstract AuthenticationInfo
AbstractLdapRealm. queryForAuthenticationInfo(AuthenticationToken token, LdapContextFactory ldapContextFactory)
Abstract method that should be implemented by subclasses to builds anAuthenticationInfo
object by querying the LDAP context for the specified username.protected AuthenticationInfo
DefaultLdapRealm. queryForAuthenticationInfo(AuthenticationToken token, LdapContextFactory ldapContextFactory)
This implementation opens an LDAP connection using the token'sdiscovered principal
and providedcredentials
. -
Uses of AuthenticationInfo in org.apache.shiro.subject
Methods in org.apache.shiro.subject that return AuthenticationInfo Modifier and Type Method Description AuthenticationInfo
SubjectContext. getAuthenticationInfo()
Methods in org.apache.shiro.subject with parameters of type AuthenticationInfo Modifier and Type Method Description void
SubjectContext. setAuthenticationInfo(AuthenticationInfo info)
-
Uses of AuthenticationInfo in org.apache.shiro.subject.support
Methods in org.apache.shiro.subject.support that return AuthenticationInfo Modifier and Type Method Description AuthenticationInfo
DefaultSubjectContext. getAuthenticationInfo()
Methods in org.apache.shiro.subject.support with parameters of type AuthenticationInfo Modifier and Type Method Description void
DefaultSubjectContext. setAuthenticationInfo(AuthenticationInfo info)
-