We have two websites with different domain names. One of them is a wordpress site. Both websites have their own authentication system.
For the sake of convenience, it was decided to have a single authentication for both website and making use of session cookies. I searched about it and got to know about Single Sign On. Can anybody tell me how to implement SSO when one of the website is a wordpress site(if this makes any difference)? I would highly appreciate if any help comes.
Pretty simple actually. From the non-wordpress site, you just need to make the login form connect to the wordpress database and check the user-provided credentials. WordPress uses an md5 password hash, so make sure you hash the users password with the md5() function before passing it to the database. Handle the return results as normal.
One note, make sure that your database user has permissions from the connecting host. If both sites are hosted on the same server (and IP), it won’t be an issue regardless. If not, you need to make sure the database user either has permissions from the second IP or from everywhere (‘user’@’%’).