Need to use Wordpress page as authentication for different service

I am first timer with Wordpress and I would really need help or advice. I have an mobile app service on VPS and client suggested that it would be nice to have singular login info to the App and his sort of related web pages. Now, I can do this in multiple ways, but it seems like best solution would be use the rest api of WP to do the auth work, however after days of research and tries, I haven't managed to do that. I was think about using the end-point of wp-json/wp/v2/users/me with JSON basic auth, however despite trying few plugins, not one seems to work. I am getting rest_user_invalid_id. I found some info that modifying .htaccess will solve an issue with login, but simply no dice and since it's fully functional web page, I don't want to experiment and mess with it.

I was thinking if doing my own end-point, wouldn't be better, because I got fully done website, where my work is just the integration with my service, but I am not sure if I can do freely SQL queries and stuff like that. How would access to the db worked, since I only have access to Wordpress dashboard.

I can fully customize my service, I can make it so it suites Wordpress style. All I want is to access, create and verify users, so I can integrate at least the same user login details to webpage as well as my service. So I would like to know the best and most secure approach?

Topic authentication web-services rest-api users Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.