• My client has wordpress website and he needs to built an react native app using REST API. WordPress website used by many users. I tried to login using admin credentials and I got jwt token back from “/wp-json/api/v1/token” But same url returns below error when a customer/User tried to login

    {
    "status": "error",
    "error": "INVALID_CREDENTIALS",
    "code": "400",
    "error_description": "Invalid username or password."
    }

    Does jwt-token only works for admin user only?
    How can all the users of website can login to app as they login to wordpress website?

    Appreciate any response on this.

    • This topic was modified 2 years, 9 months ago by victorjnhero.
    • This topic was modified 2 years, 9 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I assume you are using the JWT Auth plugin. I suggest asking in their dedicated forum anything specific about the plugin.
    https://www.ads-software.com/support/plugin/jwt-authentication-for-wp-rest-api/

    I will observe though that what’s available through the API for a generic subscriber user may be pretty limited. You may find the need to interact with the API using elevated credentials beyond the current user’s capabilities. I like the Applications Passwords in such a situation, though JWT Auth is fine as well.

    I’m unsure if there’s a way to authorize generic users through the API if you are not establishing API credentials. It might require a process outside of the API, such as Ajax requests. To be clear “might require” means I’m speculating wildly, I don’t really know.

Viewing 1 replies (of 1 total)
  • The topic ‘uild React Native app for wordpress website using JWT-Token REST API’ is closed to new replies.