I'm using Advanced Access Manager (AAM) plugin, and have been trying to refresh a still valid JWT token using the /aam/v1/refresh-jwt
RESTful endpoing, however I’m getting the following error:
“rest_jwt_validation_failure”: [“Wrong number of segments”]
The way I’m calling the endpoint is as follows:
POST {{Base URL}}/wp-json/aam/v1/authenticate
HEADERS Authentication: Bearer {{token}}
Any though on what am I doing wrong?
I'm using Advanced Access Manager (AAM) plugin, and have been trying to refresh a still valid JWT token using the /aam/v1/refresh-jwt
RESTful endpoing, however I’m getting the following error:
“rest_jwt_validation_failure”: [“Wrong number of segments”]
The way I’m calling the endpoint is as follows:
POST {{Base URL}}/wp-json/aam/v1/authenticate
HEADERS Authentication: Bearer {{token}}
Any though on what am I doing wrong?
Share Improve this question asked Jul 12, 2019 at 11:54 nikanonikano 1033 bronze badges 01 Answer
Reset to default 1At first glance it looks like you need to POST the token as a 'jwt' property in a JSON object, the same way you'd POST it to the validate endpoint:
curl -X POST \
http://dev.wordpress/wp-json/aam/v1/refresh-jwt \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"jwt": "0yJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1NDM4OTExNjQsImV4cCI6MTU0Mzk3NzU2NCwidXNlcklkIjoxfQ.0wGIbcTDH5yWSsdStZFct_-auyOFJqf3NKQasTCs4QU"
}'
(based on https://forum.aamplugin/d/4-how-to-validate-jwt-token)
It doesn't look like this code reads the token from the Authorization header (and it's 'Authorization' not 'Authentication').
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745326785a4622693.html
评论列表(0条)