November 2018
Intermediate to advanced
388 pages
9h 5m
English
Similar to the issueToken() function, we create a function called verifyToken() with the @Path annotation in the AuthenticationController class. This maps the URI with /authorize/jwt/verify-token to the verifyToken() function:
@POST@Path("/jwt/verify-token")@Produces(MediaType.APPLICATION_JSON)fun verifyToken(@Context httpServletRequest: HttpServletRequest, @Context httpServletResponse: HttpServletResponse): Response { var header: String = httpServletRequest.getHeader("Authorization") var token: String = extractJwtToken(header); val expiresIn:Long = verifyJwt(token) return Response.status(200).entity(JSONObject("{\"token\":\"active\"," + "\"expiresInSeconds\":$expiresIn }")).build()}
The ...
Read now
Unlock full access