validate_jwt
This endpoint allows you to verify valid JSON Web Token JWT. The generated token will include user cookie, ID, and username, apart from expiry and domain and other information.
In addition to the token signature verification, this end point will also verify if the cookie is valid or not. Internally, cookie will be used to identify to user.
There are three ways you can send the values to the endpoint:
- With standard Post method
- With the header Authorization: Bearer Token
- With the JSON raw body data format
Please see Postman screenshot for all three requests.
With standard Post method:
With the header Authorization: Bearer Token:
With the JSON raw body data format:
Resource URL
http://localhost/api/userplus/validate_jwt/
Method
POST
Required Parameters
- jwt
- key – get API key from Settings > User Plus
Optional Parameters
- none
Sample Request URL
http://localhost/api/userplus/validate_jwt/?key=KEY-HERE&jwt=TOKEN-HERE
Sample Response
{
"status": "ok",
"jwt": {
"iat": 1594387374,
"iss": "www.wppim.com",
"nbf": 1594387434,
"exp": 1595597034,
"user": {
"id": 1,
"username": "sample-user",
"cookie": "sample-user|1595597034|huDz6GmB6xXTpxn6699M4OICbG6m6yJve4Gg8|17d43fce1fa6b5657f9baf7089ca4d9285667d1e06099b5d21688f6948f5b633"
}
},
"cookie_valid": true
}