Title: Cannot access jwt protected api endpoints
Last modified: March 17, 2022

---

# Cannot access jwt protected api endpoints

 *  Resolved [Earthman Media](https://wordpress.org/support/users/earthman100/)
 * (@earthman100)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/cannot-access-jwt-protected-api-endpoints/)
 * When I use Postman app to try to test the endpoints that are protected by your
   plugin:
 * First: Auth is enabled. I use that endpoint to get a token. That works fine.
 * Second: I use Header: “Authorization: Bearer (that token)” to try to access api
   protected endpoints, as enabled in the admin ui for your plugin:
 * I get error:
 *     ```
       {
           "code": "invalid_username",
           "message": "<strong>Error</strong>: Unknown username. Check again or try your email address.",
           "data": null
       }
       ```
   
 * …every time, no matter what user I use and what new token I create.
 * Can you please tell me what I might be missing? Is this expected behaviour?
 * —
 * Sidenote: Without a token, i get the expected result:
 *     ```
       {
           "success": false,
           "data": {
               "message": "Your are not authorized to access this endpoint.",
               "errorCode": 403,
               "type": "simple-jwt-login-route-protect"
           }
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Earthman Media](https://wordpress.org/support/users/earthman100/)
 * (@earthman100)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/cannot-access-jwt-protected-api-endpoints/#post-15493855)
 * Is this plugin actively supported? Does my issue make sense?
 *  Plugin Author [Nicu Micle](https://wordpress.org/support/users/nicu_m/)
 * (@nicu_m)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/cannot-access-jwt-protected-api-endpoints/#post-15499345)
 * Hello [@earthman100](https://wordpress.org/support/users/earthman100/),
 * Please check the settings under “Login” -> “JWT Login Settings “, and make sure
   you have set “Log in by WordPress username” and also set the “JWT parameter key”
   with the key for the username from your JWT payload.
 * Also, you can choose to log in by User ID or User email address.
 * The plugin uses the Login settings when trying to find a user in a JWT.
 * Please let me know if this works OK for you.
 * Best regards,
    Nicu.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cannot access jwt protected api endpoints’ is closed to new replies.

 * ![](https://ps.w.org/simple-jwt-login/assets/icon-256x256.png?rev=2106097)
 * [Simple JWT Login – Allows you to use JWT on REST endpoints.](https://wordpress.org/plugins/simple-jwt-login/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-jwt-login/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-jwt-login/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-jwt-login/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-jwt-login/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-jwt-login/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Nicu Micle](https://wordpress.org/support/users/nicu_m/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/cannot-access-jwt-protected-api-endpoints/#post-15499345)
 * Status: resolved