• Resolved nikano1991

    (@nikano1991)


    Hi,

    I have been trying to refresh a still valid JWT token using the /aam/v1/refresh-jwt, 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?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter nikano1991

    (@nikano1991)

    I figured it out.

    So this is how I was supposed to call this endpoint:

    POST {{Base URL}}/wp-json/aam/v1/authenticate
    HEADERS Content-Type: application/json
    BODY {“jwt”: {{Token}} }

    Plugin Author AAM Plugin

    (@vasyltech)

    @nikano1991 I’m glad you were able to find the solution.

    This article has all the necessary information when it comes to JWT handling https://aamplugin.com/article/ultimate-guide-to-wordpress-jwt-authentication. It also has a link to the Postman collection that should show you how to use it all.

    Keep me updated if any of the information in the article on in the PM collection is inaccurate.

    Regards,
    Vasyl

    Thread Starter nikano1991

    (@nikano1991)

    Hi @vasyltech,

    About the article you mention, I’m afraid the PostMan collection is outdated since it only contains the calls for /aam/v1/authenticate and /aam/v1/validate-jwt.

    The endpoint /aam/v1/refresh-jwt is not present in the collection. I was able to deduce how to call it using /aam/v1/validate-jwt as reference.

    I hope it helps ??

    Thanks,
    marc

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘RESTful endpoint to refresh token’ is closed to new replies.