Page 1 of 1

Single sign-on when using two PHP web applications

Posted: Wed Sep 16, 2009 11:49 pm
by vlinet2002
I have a web application that has it's own simple user login/logout. I wish to integrate PHP based forum software such as Phorum or MyBB.

Whenever a user does login to my web application, I want the user to login with the forum software. When the user does logout, then it has to be logged out in both the web application & forum software.

How can this be achieved? I'll be happy to try out pseudo code suggestions from the forum members and post the working code if I can crack one.

Thank you.

Re: Single sign-on when using two PHP web applications

Posted: Thu Sep 17, 2009 12:24 am
by dude81
One idea I've is
1. Finalize on one of the forum to use.
2. Analyze the login functionality of the Forum, see what tables are being effected by the login.
3. Make an API for Login, Logout , Register functionality for the forum
4. Make an API for Login, Logout, Create account functionality for your application.
5. Each time a user is creating account, do call the Register functionality API and create the same user in the forum.
6. Make a common database which will generate sessions for the users. This sessions table will be in the common database, as well as this would be in your application database and in forum database. This is the one which will generate session and would say the user logged in is authentic or not. .

Hope it does not sound like crap... :roll: