APIs that you can use in frontend to encode, decode and verify JWT.
Things that are true for all the API endpoints
- Returns
jsonorhtmldata only. - For
jsonresponse, addContent-Type: application/jsonin headers. This documentation assumes that you're requestingjsoncontent type only. - Each API response will have
{ statusText: "", statusCode: "" }wherestatusTextis the status of the response that can be shown to the user to inform about the status of requeststatusCodeis a code that can be used by the developer to handle various cases for the request
- Follows HTTP status code semantics for REST i.e.
HTTP 200for successful requestHTTP 201for successfully creating the resourceHTTP 400for validation errorHTTP 403for unauthorized accessHTTP 500for internal error on the server
- Get default token
- Create token
- Verify token
GET /jwt
Response
{ token: jwtJson }
POST /jwt
Request body
alg: algorithm to use for signing tokenpayload: payload for JWT
Response
{ token: jwtJson }
GET /jwt/verify/:jwtTokenString
jwtTokenString: JWT as a token string
Response
{ decodedToken: decodedTokenJsonObject }
POST /demo/protected/api/bearer
Headers
Authorization: JWT string written asBearer ${jwtString}