The jwt-client helps to test the WP REST API authentication using the JWT Authentication for WP REST API on a WordPress installation.
The client signs the user using their user and password against WordPress and gets the JWT Token for future requests.
Once the user is signed, a simple dashboard is loaded with the user's information that is obtained from the wp-json/wp/v2/users/me
endpoint; this endpoint is only accessible for signed users and with that, we test the token integrity and the authentication, if this request works, all the other restringed endpoints should work too.
Finally, there is a third call, using the Verify Token button that consumes the jwt-auth/v1/token/validate
to ensure the token is still valid and print the response code and status.
The Logout button just reset the token on the app.
NOTE: The app is only for testing purposes and is not ready to be used in production.
The app is made with React Native, Expo and Tailwind 🚀
git clone git@github.com:Tmeister/jwt-client.git
npm install
Line #1 on the services/index.js file
npm run ios #or
npm run android #or
npm run start
You can find more information about the depedencies and setup on the Expo documentation