Single sign-on when using two PHP web applications

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vlinet2002
Forum Newbie
Posts: 4
Joined: Fri Sep 11, 2009 6:12 am

Single sign-on when using two PHP web applications

Post 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.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

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

Post 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:
Post Reply