Interface LoginService
- All Known Implementing Classes:
- AbstractLoginService, DataSourceLoginService, EmptyLoginService, HashLoginService, JAASLoginService, JDBCLoginService, OpenIdLoginService, SPNEGOLoginService
public interface LoginService
Login Service Interface.
The Login service provides an abstract mechanism for an Authenticator
to check credentials and to create a UserIdentity using the
set IdentityService.
- 
Method SummaryModifier and TypeMethodDescriptionGet the IdentityService associated with this Login Service.getName()default UserIdentitygetUserIdentity(Subject subject, Principal userPrincipal, boolean create) Get or create aUserIdentitythat is not authenticated by theLoginService.login(String username, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Login a user.voidlogout(UserIdentity user) voidsetIdentityService(IdentityService service) Set the IdentityService associated with this Login Service.booleanvalidate(UserIdentity user) Validate a user identity.
- 
Method Details- 
getNameString getName()- Returns:
- Get the name of the login service (aka Realm name)
 
- 
loginUserIdentity login(String username, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Login a user.- Parameters:
- username- The username.
- credentials- The users credentials.
- request- The request or null
- getOrCreateSession- function to retrieve or create a session.
- Returns:
- A UserIdentity if the credentials matched, otherwise null
 
- 
getUserIdentityGet or create aUserIdentitythat is not authenticated by theLoginService. Typically, this method is used when a user is separately authenticated, but the roles of this service are needed for authorization.- Parameters:
- subject- The subject
- userPrincipal- the userPrincipal
- create- If true, the- getIdentityService()may be used to create a new- UserIdentity.
- Returns:
- A UserIdentityor null.
 
- 
validateValidate a user identity. Validate that a UserIdentity previously created by a call tologin(String, Object, Request, Function)is still valid.- Parameters:
- user- The user to validate
- Returns:
- true if authentication has not been revoked for the user.
 
- 
getIdentityServiceIdentityService getIdentityService()Get the IdentityService associated with this Login Service.- Returns:
- the IdentityService associated with this Login Service.
 
- 
setIdentityServiceSet the IdentityService associated with this Login Service.- Parameters:
- service- the IdentityService associated with this Login Service.
 
- 
logout
 
-