java.lang.Object
com.mirna.hospitalmanagementapi.application.services.auth.jwt.TokenServiceImpl
All Implemented Interfaces:
TokenService

@Service public class TokenServiceImpl extends Object implements 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 Details

    • TokenServiceImpl

      public TokenServiceImpl()
  • Method Details

    • generateToken

      public String generateToken(User user)
      Generates the authorization token
      Specified by:
      generateToken in interface TokenService
      Parameters:
      user - The authenticated user
      Returns:
      A string containing the authorization token
    • getTokenSubject

      public String getTokenSubject(String token)
      Gets the jwt subject
      Specified by:
      getTokenSubject in interface TokenService
      Parameters:
      token - The json web token on request header
      Returns:
      A string containing the subject from the decoded jwt