Package org.apache.shiro.authc
Interface Authenticator
-
- All Known Subinterfaces:
SecurityManager
- All Known Implementing Classes:
AbstractAuthenticator
,AuthenticatingSecurityManager
,AuthorizingSecurityManager
,CachingSecurityManager
,DefaultSecurityManager
,ModularRealmAuthenticator
,RealmSecurityManager
,SessionsSecurityManager
public interface Authenticator
An Authenticator is responsible for authenticating accounts in an application. It is one of the primary entry points into the Shiro API. Although not a requirement, there is usually a single 'master' Authenticator configured for an application. Enabling Pluggable Authentication Module (PAM) behavior (Two Phase Commit, etc.) is usually achieved by the singleAuthenticator
coordinating and interacting with an application-configured set ofRealm
s. Note that most Shiro users will not interact with anAuthenticator
instance directly. Shiro's default architecture is based on an overallSecurityManager
which typically wraps anAuthenticator
instance.- Since:
- 0.1
- See Also:
SecurityManager
,AbstractAuthenticator
,ModularRealmAuthenticator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AuthenticationInfo
authenticate(AuthenticationToken authenticationToken)
Authenticates a user based on the submittedAuthenticationToken
.
-
-
-
Method Detail
-
authenticate
AuthenticationInfo authenticate(AuthenticationToken authenticationToken) throws AuthenticationException
Authenticates a user based on the submittedAuthenticationToken
. If the authentication is successful, anAuthenticationInfo
instance is returned that represents the user's account data relevant to Shiro. This returned object is generally used in turn to construct aSubject
representing a more complete security-specific 'view' of an account that also allows access to aSession
.- Parameters:
authenticationToken
- any representation of a user's principals and credentials submitted during an authentication attempt.- Returns:
- the AuthenticationInfo representing the authenticating user's account data.
- Throws:
AuthenticationException
- if there is any problem during the authentication process. See the specific exceptions listed below to as examples of what could happen in order to accurately handle these problems and to notify the user in an appropriate manner why the authentication attempt failed. Realize an implementation of this interface may or may not throw those listed or may throw other AuthenticationExceptions, but the list shows the most common ones.- See Also:
ExpiredCredentialsException
,IncorrectCredentialsException
,ExcessiveAttemptsException
,LockedAccountException
,ConcurrentAccessException
,UnknownAccountException
-
-