php - Wordpress authentication through a C++ program


Short version: I have a server program that I wrote with C++, and a website with Wordpress. I would like to compare the password given by the user to the password stored in Wordpress to log the user in.

Long version: At the beginning I thought that Wordpress uses MD5 hashes due to the password reset mechanism, but it turns out that Wordpress changes the hash after resetting the password, so it's not MD5 anymore. I have access to the database and I can import the users table. The webserver, the database and the C++ server I wrote run on the same machine with Debian. How can verify a password on C/C++ from Wordpress?




I always assumed wordpress did use MD5 unless you configure it otherwise. The reason why you see the hash changing is probably due to their use of a random salt.

I think your 2 choices boil down to:

  • Query the MySQL DB directly
  • Shell out to a PHP bootstrap program that includes the skeleton wordpress and pass the username/password via command line to the wordpress API credential check

People are also looking for solutions to the problem: Read soap xml with php


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.