Class TokenServiceImpl
java.lang.Object
com.mirna.hospitalmanagementapi.application.services.auth.jwt.TokenServiceImpl
- All Implemented Interfaces:
TokenService
This class is an implementation of the TokenService interface.
This class provides methods to perform operations using the jwt (json web token) feature
- Version:
- 1.0
- Author:
- Mirna Gama
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateToken(User user) Generates the authorization tokengetTokenSubject(String token) Gets the jwt subject
-
Constructor Details
-
TokenServiceImpl
public TokenServiceImpl()
-
-
Method Details
-
generateToken
Generates the authorization token- Specified by:
generateTokenin interfaceTokenService- Parameters:
user- The authenticated user- Returns:
- A string containing the authorization token
-
getTokenSubject
Gets the jwt subject- Specified by:
getTokenSubjectin interfaceTokenService- Parameters:
token- The json web token on request header- Returns:
- A string containing the subject from the decoded jwt
-