Uses of Interface
org.apache.shiro.authc.AuthenticationToken
-
Packages that use AuthenticationToken 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 theCredentialsMatcherinterface 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 theseRealms).org.apache.shiro.mgt Provides the masterSecurityManagerinterface 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 coreRealminterface.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 theSubjectinterface, the most important concept in Shiro's API.org.apache.shiro.subject.support Concrete support implementations of most of theorg.apache.shiro.subjectinterfaces. -
-
Uses of AuthenticationToken in org.apache.shiro.authc
Subinterfaces of AuthenticationToken in org.apache.shiro.authc Modifier and Type Interface Description interfaceHostAuthenticationTokenAHostAuthenticationTokenretains the host information from where an authentication attempt originates.interfaceRememberMeAuthenticationTokenAnAuthenticationTokenthat indicates if the user wishes their identity to be remembered across sessions.Classes in org.apache.shiro.authc that implement AuthenticationToken Modifier and Type Class Description classBearerTokenAAuthenticationTokenthat contains an a Bearer token or API key, typically received via an HTTPAuthorizationheader.classUsernamePasswordTokenA simple username/password authentication token to support the most widely-used authentication mechanism.Methods in org.apache.shiro.authc with parameters of type AuthenticationToken Modifier and Type Method Description AuthenticationInfoAbstractAuthenticator. authenticate(AuthenticationToken token)Implementation of theAuthenticatorinterface that functions in the following manner: Calls templatedoAuthenticatemethod for subclass execution of the actual authentication behavior. If anAuthenticationExceptionis thrown duringdoAuthenticate,notifyany registeredAuthenticationListeners of the exception and then propagate the exception for the caller to handle. If no exception is thrown (indicating a successful login),notifyany registeredAuthenticationListeners of the successful attempt. Return theAuthenticationInfoAuthenticationInfoAuthenticator. authenticate(AuthenticationToken authenticationToken)Authenticates a user based on the submittedAuthenticationToken.protected abstract AuthenticationInfoAbstractAuthenticator. doAuthenticate(AuthenticationToken token)Template design pattern hook for subclasses to implement specific authentication behavior.protected voidAbstractAuthenticator. notifyFailure(AuthenticationToken token, AuthenticationException ae)Notifies any registeredAuthenticationListeners that authentication failed for the specifiedtokenwhich resulted in the specifiedaeexception.protected voidAbstractAuthenticator. notifySuccess(AuthenticationToken token, AuthenticationInfo info)Notifies any registeredAuthenticationListeners that authentication was successful for the specifiedtokenwhich resulted in the specifiedinfo.voidAuthenticationListener. onFailure(AuthenticationToken token, AuthenticationException ae)Callback triggered when an authentication attempt for aSubjecthas failed.voidAuthenticationListener. onSuccess(AuthenticationToken token, AuthenticationInfo info)Callback triggered when an authentication attempt for aSubjecthas succeeded. -
Uses of AuthenticationToken in org.apache.shiro.authc.credential
Methods in org.apache.shiro.authc.credential with parameters of type AuthenticationToken Modifier and Type Method Description booleanAllowAllCredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)Returnstruealways no matter what the method arguments are.booleanCredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)Returnstrueif the provided token credentials match the stored account credentials,falseotherwise.booleanHashedCredentialsMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)This implementation first hashes thetoken's credentials, potentially using asaltif theinfoargument is aSaltedAuthenticationInfo.booleanPasswordMatcher. doCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)booleanSimpleCredentialsMatcher. 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 ObjectSimpleCredentialsMatcher. getCredentials(AuthenticationToken token)Returns thetoken's credentials.protected ObjectHashedCredentialsMatcher. getSalt(AuthenticationToken token)Deprecated.since Shiro 1.1.protected ObjectPasswordMatcher. getSubmittedPassword(AuthenticationToken token)protected ObjectHashedCredentialsMatcher. hashProvidedCredentials(AuthenticationToken token, AuthenticationInfo info)Hash the providedtoken's credentials using the salt stored with the account if theinfoinstance is aninstanceofSaltedAuthenticationInfo(see the class-level JavaDoc for why this is the preferred approach). -
Uses of AuthenticationToken in org.apache.shiro.authc.pam
Methods in org.apache.shiro.authc.pam with parameters of type AuthenticationToken Modifier and Type Method Description AuthenticationInfoAbstractAuthenticationStrategy. afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)Simply returns theaggregateargument without modification.AuthenticationInfoAtLeastOneSuccessfulStrategy. afterAllAttempts(AuthenticationToken token, AuthenticationInfo aggregate)Ensures that theaggregatemethod argument is notnullandaggregate.is notgetPrincipals()null, and if either isnull, throws an AuthenticationException to indicate that none of the realms authenticated successfully.AuthenticationInfoAuthenticationStrategy. 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.AuthenticationInfoAbstractAuthenticationStrategy. afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo singleRealmInfo, AuthenticationInfo aggregateInfo, Throwable t)Base implementation that will aggregate the specifiedsingleRealmInfointo theaggregateInfoand then returns the aggregate.AuthenticationInfoAllSuccessfulStrategy. afterAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo info, AuthenticationInfo aggregate, Throwable t)Merges the specifiedinfointo theaggregateargument and returns it (just as the parent implementation does), but additionally ensures the following: if theThrowableargument is notnull, re-throws it to immediately cancel the authentication process, since this strategy requires all realms to authenticate successfully. neither theinfooraggregateargument isnullto ensure that each realm did in fact authenticate successfullyAuthenticationInfoAuthenticationStrategy. 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.AuthenticationInfoAbstractAuthenticationStrategy. beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token)Simply returnsnew, which supports aggregating account data across realms.SimpleAuthenticationInfo();AuthenticationInfoAuthenticationStrategy. 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 anyRealmis actually invoked.AuthenticationInfoFirstSuccessfulStrategy. beforeAllAttempts(Collection<? extends Realm> realms, AuthenticationToken token)Returnsnullimmediately, relying on this class'smergeimplementation to return only the firstinfoobject it encounters, ignoring all subsequent ones.AuthenticationInfoAbstractAuthenticationStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)Simply returns theaggregatemethod argument, without modification.AuthenticationInfoAllSuccessfulStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo info)Because all realms in this strategy must complete successfully, this implementation ensures that the givenRealmsupportsthe giventokenargument.AuthenticationInfoAuthenticationStrategy. 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.AuthenticationInfoFirstSuccessfulStrategy. beforeAttempt(Realm realm, AuthenticationToken token, AuthenticationInfo aggregate)Throws ShortCircuitIterationException if stopAfterFirstSuccess is set and authentication is successful with a previously consulted realm.protected AuthenticationInfoModularRealmAuthenticator. doAuthenticate(AuthenticationToken authenticationToken)Attempts to authenticate the given token by iterating over the internal collection ofRealms.protected AuthenticationInfoModularRealmAuthenticator. doMultiRealmAuthentication(Collection<Realm> realms, AuthenticationToken token)Performs the multi-realm authentication attempt by calling back to aAuthenticationStrategyobject as each realm is consulted forAuthenticationInfofor the specifiedtoken.protected AuthenticationInfoModularRealmAuthenticator. 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. -
Uses of AuthenticationToken in org.apache.shiro.mgt
Methods in org.apache.shiro.mgt with parameters of type AuthenticationToken Modifier and Type Method Description AuthenticationInfoAuthenticatingSecurityManager. authenticate(AuthenticationToken token)Delegates to the wrappedAuthenticatorfor authentication.protected SubjectDefaultSecurityManager. createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing)Creates aSubjectinstance for the user represented by the given method arguments.protected booleanAbstractRememberMeManager. isRememberMe(AuthenticationToken token)Determines whether or not remember me services should be performed for the specified token.SubjectDefaultSecurityManager. login(Subject subject, AuthenticationToken token)First authenticates theAuthenticationTokenargument, and if successful, constructs aSubjectinstance representing the authenticated account's identity.SubjectSecurityManager. login(Subject subject, AuthenticationToken authenticationToken)Logs in the specified Subject using the givenauthenticationToken, returning an updated Subject instance reflecting the authenticated state if successful or throwingAuthenticationExceptionif it is not.voidAbstractRememberMeManager. onFailedLogin(Subject subject, AuthenticationToken token, AuthenticationException ae)Reacts to a failed login by immediatelyforgettingany previously remembered identity.protected voidDefaultSecurityManager. onFailedLogin(AuthenticationToken token, AuthenticationException ae, Subject subject)voidRememberMeManager. onFailedLogin(Subject subject, AuthenticationToken token, AuthenticationException ae)Reacts to a failed authentication attempt, typically by forgetting any previously remembered principals for the Subject.voidAbstractRememberMeManager. onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info)Reacts to the successful login attempt by first alwaysforgettingany previously stored identity.protected voidDefaultSecurityManager. onSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject)voidRememberMeManager. 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.voidAbstractRememberMeManager. rememberIdentity(Subject subject, AuthenticationToken token, AuthenticationInfo authcInfo)Remembers a subject-unique identity for retrieval later.protected voidDefaultSecurityManager. rememberMeFailedLogin(AuthenticationToken token, AuthenticationException ex, Subject subject)protected voidDefaultSecurityManager. rememberMeSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject) -
Uses of AuthenticationToken in org.apache.shiro.realm
Methods in org.apache.shiro.realm with parameters of type AuthenticationToken Modifier and Type Method Description protected voidAuthenticatingRealm. assertCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)Asserts that the submittedAuthenticationToken's credentials match the stored accountAuthenticationInfo's credentials, and if not, throws anAuthenticationException.protected abstract AuthenticationInfoAuthenticatingRealm. doGetAuthenticationInfo(AuthenticationToken token)Retrieves authentication data from an implementation-specific datasource (RDBMS, LDAP, etc) for the given authentication token.protected AuthenticationInfoSimpleAccountRealm. doGetAuthenticationInfo(AuthenticationToken token)protected ObjectAuthenticatingRealm. getAuthenticationCacheKey(AuthenticationToken token)Returns the key under whichAuthenticationInfoinstances are cached if authentication caching is enabled.AuthenticationInfoAuthenticatingRealm. getAuthenticationInfo(AuthenticationToken token)This implementation functions as follows: It attempts to acquire any cachedAuthenticationInfocorresponding to the specifiedAuthenticationTokenargument.AuthenticationInfoRealm. 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.protected booleanAuthenticatingRealm. isAuthenticationCachingEnabled(AuthenticationToken token, AuthenticationInfo info)Returnstrueif authentication caching should be utilized based on the specifiedAuthenticationTokenand/orAuthenticationInfo,falseotherwise.booleanAuthenticatingRealm. supports(AuthenticationToken token)Convenience implementation that returns getAuthenticationTokenClass().isAssignableFrom( token.getClass() );.booleanRealm. supports(AuthenticationToken token)Returns true if this realm wishes to authenticate the Subject represented by the givenAuthenticationTokeninstance, false otherwise.Method parameters in org.apache.shiro.realm with type arguments of type AuthenticationToken Modifier and Type Method Description voidAuthenticatingRealm. setAuthenticationTokenClass(Class<? extends AuthenticationToken> authenticationTokenClass)Sets the authenticationToken class supported by this realm. -
Uses of AuthenticationToken in org.apache.shiro.realm.activedirectory
Methods in org.apache.shiro.realm.activedirectory with parameters of type AuthenticationToken Modifier and Type Method Description protected AuthenticationInfoActiveDirectoryRealm. queryForAuthenticationInfo(AuthenticationToken token, LdapContextFactory ldapContextFactory)Builds anAuthenticationInfoobject by querying the active directory LDAP context for the specified username. -
Uses of AuthenticationToken in org.apache.shiro.realm.jdbc
Methods in org.apache.shiro.realm.jdbc with parameters of type AuthenticationToken Modifier and Type Method Description protected AuthenticationInfoJdbcRealm. doGetAuthenticationInfo(AuthenticationToken token) -
Uses of AuthenticationToken in org.apache.shiro.realm.ldap
Methods in org.apache.shiro.realm.ldap with parameters of type AuthenticationToken Modifier and Type Method Description protected AuthenticationInfoDefaultLdapRealm. createAuthenticationInfo(AuthenticationToken token, Object ldapPrincipal, Object ldapCredentials, LdapContext ldapContext)Returns theAuthenticationInforesulting from a Subject's successful LDAP authentication attempt.protected AuthenticationInfoAbstractLdapRealm. doGetAuthenticationInfo(AuthenticationToken token)protected AuthenticationInfoDefaultLdapRealm. doGetAuthenticationInfo(AuthenticationToken token)Delegates toDefaultLdapRealm.queryForAuthenticationInfo(org.apache.shiro.authc.AuthenticationToken, LdapContextFactory), wrapping anyNamingExceptions in a ShiroAuthenticationExceptionto satisfy the parent method signature.protected ObjectDefaultLdapRealm. getLdapPrincipal(AuthenticationToken token)Returns the principal to use when creating the LDAP connection for an authentication attempt.protected abstract AuthenticationInfoAbstractLdapRealm. queryForAuthenticationInfo(AuthenticationToken token, LdapContextFactory ldapContextFactory)Abstract method that should be implemented by subclasses to builds anAuthenticationInfoobject by querying the LDAP context for the specified username.protected AuthenticationInfoDefaultLdapRealm. queryForAuthenticationInfo(AuthenticationToken token, LdapContextFactory ldapContextFactory)This implementation opens an LDAP connection using the token'sdiscovered principaland providedcredentials. -
Uses of AuthenticationToken in org.apache.shiro.subject
Methods in org.apache.shiro.subject that return AuthenticationToken Modifier and Type Method Description AuthenticationTokenSubjectContext. getAuthenticationToken()Methods in org.apache.shiro.subject with parameters of type AuthenticationToken Modifier and Type Method Description voidSubject. login(AuthenticationToken token)Performs a login attempt for this Subject/user.voidSubjectContext. setAuthenticationToken(AuthenticationToken token) -
Uses of AuthenticationToken in org.apache.shiro.subject.support
Methods in org.apache.shiro.subject.support that return AuthenticationToken Modifier and Type Method Description AuthenticationTokenDefaultSubjectContext. getAuthenticationToken()Methods in org.apache.shiro.subject.support with parameters of type AuthenticationToken Modifier and Type Method Description voidDelegatingSubject. login(AuthenticationToken token)voidDefaultSubjectContext. setAuthenticationToken(AuthenticationToken token)
-