APIs that you can use in frontend to encode, decode and verify JWT.
Things that are true for all the API endpoints
- Returns
json
orhtml
data only. - For
json
response, addContent-Type: application/json
in headers. This documentation assumes that you're requestingjson
content type only. - Each API response will have
{ statusText: "", statusCode: "" }
wherestatusText
is the status of the response that can be shown to the user to inform about the status of requeststatusCode
is 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 200
for successful requestHTTP 201
for successfully creating the resourceHTTP 400
for validation errorHTTP 403
for unauthorized accessHTTP 500
for 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}