Hi,
I want to link Elgg from another web app, allowing the users already loged in it to access Elgg directly.
Which is the simplest way to do it?
The other app is hosted in the same server, and it's not a standard app, so it's not necessary an open (and more complex) solution like OAuth
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Salva Maine@salvamaine

Salva Maine - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
- Salva Maine@salvamaine

Salva Maine - 0 likes
- Kevin Jardine@kevin

Kevin Jardine - 0 likes
You must log in to post replies.I have written several integrations (eg. for Vanilla forum and Mediawiki) using the Elgg cookie.
You just need to write a bit of code allowing each app to access the other's database tables and you're up and running.
Thanks, Kevin;
can you name the steps to do the external app->elgg automatic login? I gess that you send a login HTML request with the user name as param and then override the Elgg auth system to read the user / key pair in the external database...
---
salva
I suggest that you look at the source for one of the plugins I mentioned.
I don't over-ride the Elgg auth system. Elgg is the auth system. I over-ride the other app's system to authenticate off the Elgg cookie.
So in that sense, Elgg is the master and the other app is the slave.
Having said that, it is easy enough to do it the other way round.
the structure would be:
$username = get_username_from_other_app_cookie();
$user = get_user_by_username($username);
login($user);
Ok, but where would you put that code? It doesn't seem to work doing that into engine/lib/sessions.php->authenticate
You would put it in a plugin.
Never alter core code.