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 givenusername
andpassword
.void
logout
(LoggedUser user) Logs out the given inputuser
.
-
Field Details
-
tokens
-
userRepository
-
userService
-
userSessionService
-
-
Constructor Details
-
TokenAuthenticationService
TokenAuthenticationService()
-
-
Method Details
-
login
Description copied from interface:UserAuthenticationService
Logs in with the givenusername
andpassword
.- Specified by:
login
in interfaceUserAuthenticationService
- Returns:
- an
Optional
of a user when login succeeds
-
login
Description copied from interface:UserAuthenticationService
Logs in with the givenusername
.- Specified by:
login
in interfaceUserAuthenticationService
- Returns:
- an
Optional
of a user when login succeeds
-
findByToken
Description copied from interface:UserAuthenticationService
Finds a user by its dao-key.- Specified by:
findByToken
in interfaceUserAuthenticationService
- Parameters:
token
- user dao key- Returns:
-
logout
Description copied from interface:UserAuthenticationService
Logs out the given inputuser
.- Specified by:
logout
in interfaceUserAuthenticationService
- Parameters:
user
- the user to logout
-