I stuck in a small problem. I want to login from a third party provider. I have a PHP script and set a database behind where user credentials are stored, so the user access the external site by a link and there the user can login to the central service, afterwords the user get redirected back to the website where it comes from. At that point the application/website where the user comes from could access over a one time code the user credentials and use it to login into the website. My problem now is, how to login to wordpress with the login credentials from my php application. The idea is, if the user use it the first time, than a separate script will create a entry in the database table, what seems easier, but still Im missing how to login on wp-login.php if I have the login credentials. As I know GET method is a very bad idea for this. Hope you can help.


  • there seems to be a lot of red flags here, would it not be easier to store users in the wordpress database as users? – Ben Casey Jun 2 '19 at 22:26
  • @BenCasey I want to run it as a separate identity provider service for a regional community, so not everyone has the need to use it. The idea is to make it as a regional identity provider and so regional services can attach to it, so people doesnt need to make a new account on every service itself. Due Wordpress is the most used CMS for websites, I thought it make sense to begin here. – Petr Jun 2 '19 at 22:46
  • In that case it would be a more secure structure to use WP as the user database and the JSON API to connect services to it. – Ben Casey Jun 3 '19 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.