Class AnyUserLoginService
- All Implemented Interfaces:
 LoginService
LoginService which allows unknown users to be authenticated.
This is useful for authentication protocols like OpenID Connect and Sign in With Ethereum, where Jetty doesn't store a collection of user credentials and passwords. Once the user proves authenticates themselves through the respective protocol, Jetty does not have to validate any credential.
This can delegate to a nested LoginService which can supply roles for known users.
This nested LoginService is supplied to the constructor, and this will first attempt to log in
with the nested LoginService and only create a new UserIdentity if none was found with
LoginService.login(String, Object, Request, Function)
This LoginService does not check credentials, a UserIdentity will be produced for any
username provided in login(String, Object, Request, Function).
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionGet the IdentityService associated with this Login Service.getName()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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LoginService
getUserIdentity 
- 
Constructor Details
- 
AnyUserLoginService
- Parameters:
 realm- the realm name.loginService- optionalLoginServicewhich can be used to assign roles to known users.
 
 - 
 - 
Method Details
- 
getName
- Specified by:
 getNamein interfaceLoginService- Returns:
 - Get the name of the login service (aka Realm name)
 
 - 
login
public UserIdentity login(String username, Object credentials, Request request, Function<Boolean, Session> getOrCreateSession) Description copied from interface:LoginServiceLogin a user.- Specified by:
 loginin interfaceLoginService- Parameters:
 username- The username.credentials- The users credentials.request- The request or nullgetOrCreateSession- function to retrieve or create a session.- Returns:
 - A UserIdentity if the credentials matched, otherwise null
 
 - 
validate
Description copied from interface:LoginServiceValidate a user identity. Validate that a UserIdentity previously created by a call toLoginService.login(String, Object, Request, Function)is still valid.- Specified by:
 validatein interfaceLoginService- Parameters:
 user- The user to validate- Returns:
 - true if authentication has not been revoked for the user.
 
 - 
getIdentityService
Description copied from interface:LoginServiceGet the IdentityService associated with this Login Service.- Specified by:
 getIdentityServicein interfaceLoginService- Returns:
 - the IdentityService associated with this Login Service.
 
 - 
setIdentityService
Description copied from interface:LoginServiceSet the IdentityService associated with this Login Service.- Specified by:
 setIdentityServicein interfaceLoginService- Parameters:
 service- the IdentityService associated with this Login Service.
 - 
logout
- Specified by:
 logoutin interfaceLoginService
 
 -