SSO in IPB

Put it simple IPB is most likely the most proficient Forum software nowdays.

Here is how you may interact with WordPress from IPB.

As described here.

#1 creating the sso.php file

A default template is shipped with IP.Board, called “sso.rename.php”. You can rename this file to sso.php, and then modify the 2 methods in this file as required by your site. Those two methods are:

checkSSOForGuest(): IP.Board does not recognize the current user as a member, and you are being given a chance to perform any actions that you need to in order to verify if this user is already logged in to your site. You can check cookies, $_SESSION variables, perform remote callbacks, etc. If you recognize the user as a logged in member, you should create their account if necessary, set appropriate cookies, and potentially redirect the user back to the forums.

checkSSOForMember(): IP.Board sees the current user as a logged in member. Typically you will not need to do anything here, but you could verify the user is still logged in to the front end website (for instance), or update counters for your website if necessary.

#2 extending the session class

A much more versatile and preferred method of implementing SSO is to simply extend the session handler in IP.Board. You can do this out of the box by uploading a file “ssoPublicSessions.php” to admin/sources/classes/session/. This file MUST contain a class “ssoPublicSessions” and it MUST extend the session handler class (publicSessions). This method has many advantages over the sso.php file:

ips_MemberRegistry is available through the self:: accessor. You can call any methods in the member registry that you may need to as a result.

You can overload any method in the publicSessions class as needed.

This method is likely to be more efficient (depending upon your specific code), as only one object is retained in the PHP namespace, rather than two.

Thanks

tags: & category: -