Let's write a skeleton of the controller class:
- Create an AuthenticationController class. The @Path annotation is used in the AuthenticationController class. @Path is from the jersey library, and this annotation maps the URI with /authorize to this class.
- Inject CustomAuthMechanism and HttpMessageContext, which will be used with AuthMechanism to authenticate the user's credentials.
- Create a function called issueJwt() with the @Path annotation. This maps the URI with /authorize/jwt/token to the issueJwt() function:
@Path("/authorize")class AuthenticationController { @Inject private lateinit var customAuthMechanism: CustomAuthMechanism private val httpMessageContextImpl: HttpMessageContextImpl ...