Package restapi.utils.security.auth
Class TokenAuthenticationService
java.lang.Object
restapi.utils.security.auth.TokenAuthenticationService
- All Implemented Interfaces:
UserAuthenticationService
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) @NonNull TokenService(package private) @NonNull UserRepository(package private) @NonNull UserService(package private) @NonNull UserSessionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindByToken(String token) Finds a user by its dao-key.Logs in with the givenusername.Logs in with the givenusernameandpassword.voidlogout(LoggedUser user) Logs out the given inputuser.
-
Field Details
-
tokens
-
userRepository
-
userService
-
userSessionService
-
-
Constructor Details
-
TokenAuthenticationService
TokenAuthenticationService()
-
-
Method Details
-
login
Description copied from interface:UserAuthenticationServiceLogs in with the givenusernameandpassword.- Specified by:
loginin interfaceUserAuthenticationService- Returns:
- an
Optionalof a user when login succeeds
-
login
Description copied from interface:UserAuthenticationServiceLogs in with the givenusername.- Specified by:
loginin interfaceUserAuthenticationService- Returns:
- an
Optionalof a user when login succeeds
-
findByToken
Description copied from interface:UserAuthenticationServiceFinds a user by its dao-key.- Specified by:
findByTokenin interfaceUserAuthenticationService- Parameters:
token- user dao key- Returns:
-
logout
Description copied from interface:UserAuthenticationServiceLogs out the given inputuser.- Specified by:
logoutin interfaceUserAuthenticationService- Parameters:
user- the user to logout
-