Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How is "People" supposed to work?
Hi,
I'd like to integrate vanilla with a website of mine (which is running java, maintains its own sessions
and uses no SQL db). After a quick forum-search it seems the recommended way to do that would be "People".
Okay, so I went and read the few threads on the subject and I also looked at
http://lussumo.com/swell/42/Data-Objects-External-Application-Integration/
But.. I still don't get it. :(
Can anyone explain to me how it's supposed to work?
What do I have to setup on the vanilla side and on the remote application to allow my users
to enter the vanilla forum without logging in again?
0
This discussion has been closed.
Comments
Most of the threads you're reading are probably useless to you, since they mostly deal with using Vanilla sessions in other programs.
People was written to provide a way to integrate Vanilla with any system by making configuration changes in Vanilla and *sharing* sessions.
There is not really any way for me to know what any given foreign application will require in order to integrate properly. So, the type of integration you are talking about needs to be a custom solution and doesn't really apply to People.
The methodology you are talking about uses an SSO (Single Sign On) server. Basically here is what I wrote for Vanilla:
I created a new addon folder and added the following files:
PostAccountUpdate.php (called by the SSO Server when there was a change to username or password in the other application - so that the changes reflected in Vanilla).
PostLogin.php (called by the SSO Server after it completes it's user authentication - creates a new vanilla session)
PostLogout.php (called by the SSO Server after it completes de-authentication of a user - kills an existing vanilla session)
PreLogout.php (called by Vanilla to log a person out of Vanilla and then send them to the SSO server for deauthentication. This was the flipside of PostLogout.php in case someone clicked to sign out of Vanilla instead of the other app).
There was also a utility.php file which contained some utility functions I wrote for parsing simple xml from the SSO server.
You can send a user to people.php with a ReturnUrl to somewhere else on your site and it will redirect them accordingly. But to write the integration code for your applications pages, there are two things to consider: (1) Vanilla sessions, and (2) Vanilla cookies.
1) Vanilla Sessions: These are easy. The session contains a single value: the user's UserID from the LUM_User table. If the user has an active session, you can grab any information about the user that you may want to use in a page by querying
select whatever from LUM_User where UserID = $TheUsersSessionUserIDValue
The name of the session's UserID parameter is defined in Vanilla's configuration file as SESSION_USER_IDENTIFIER. The default value for this is: LussumoUserID.
2) Vanilla Cookies: The cookies are used to "remember" a user through different Vanilla sessions (if they check the remember me box). If a user comes back to your site after a day away, you are going to want to re-authenticate them if they have valid cookies. In order to do this you will need to review the cookie values and make sure that they still match the saved authentication values from the user's last visit that have been stored in the database. In Vanilla this is done in the library/People/People.Class.Authenticator.php class in the GetIdentity Method. Basically it goes like this:
Retrieve the cookie values. There are two of them, again their names are defined in Vanilla's configuration file with the COOKIE_USER_KEY and COOKIE_VERIFICATION_KEY settings, which by default translate to: lussumocookieone and lussumocookietwo respectively. Yesterday I changed the way the cookies work a little bit after some issues arose from Entripe.
The lussumocookieone value is the user's UserID. The lussumocookietwo value matches to the VerificationKey value in the user table. So, to authenticate the user you need to
select UserID from LUM_User where UserID = $theuseridcookievalue and VerificationKey = $theverificationkeyvalue
Once you've done that, if the UserID returns from the select successfully, you can save the LussumoUserID session value as the returned UserID and you're done re-authenticating.
Just make sure that each method continues to serve it's purpose:
Authenticate: validates user input or cookies and creates session and cookie variables.
Authenticator: constructor.
DeAuthenticate: destroys cookie and session values.
GetIdentity: Looks at the session variable and returns the userid based on that.
Why do you want to change the cookie to show usernames, anyway? What difference does it make?