Check out the LimeSurvey source code on GitHub!

LDAP authentication in LS 2.00+

More
3 years 8 months ago #96840 by mdekker
There is not much documentation yet but when it comes it will be at manual.limesurvey.org/Plugins

For now you can check out the latest code on 2.05 branch from github and have a look at the core authentication plugins in /application/core/plugins
If you copy/rename them to /plugins you can create your own plugin. Since we are still exploring what would be needed to make a plugin work in all scenarios, feel free to drop a line here if something is unclear or if you can not find what you need.

When we release 2.05 we will update the documentation with the information needed to create your own plugin. Please note that we could still change the api at this moment (although we plan not to do that ofcourse).

---
Menno Dekker
The following user(s) said Thank You: atlet

Please Log in to join the conversation.

More
3 years 7 months ago #98325 by atlet
Hi,

tnx for your info. I copied the plugin and made my own. In documentation is written, that if you use a server authentication, you must set $this->setAuthPlugin() in beforeLogin but the event newUserSession is never called. I missing something?

Please Log in to join the conversation.

More
3 years 7 months ago #98344 by mdekker
setAuthPlugin disables the login form, you use this this when you don't want to ask for user input.

Why do you think newUserSession is never called? Have a look at the /application/core/plugins/Authwebserver/Authwebserver.php to see how that works.

Maybe you forgot to subscribe to the newUserSsession event?

---
Menno Dekker

Please Log in to join the conversation.

More
3 years 7 months ago #98351 by atlet
Yes, I created new plugin from this one. I subscribed to newUserSession event and also disabled login form with setAuthPlugin. When I debug, the newUserSession even't dosen't get called.

Please Log in to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #98353 by mdekker
Can you share the code somewhere? And are you sure the plugin is activated?

---
Menno Dekker
Last Edit: 3 years 7 months ago by mdekker.

Please Log in to join the conversation.

More
3 years 7 months ago #98354 by atlet
Yes, plugin is activated.

Paste is here: http://pastebin.com/njTxXMEf

I click on link to activate the "login process". Also, the user exist in db...

Please Log in to join the conversation.

More
3 years 6 months ago #98373 by mdekker
To rule out errors on other code, try moving setAuthPlugin outside the if, to line 33 for example. Then you should always reach the newUserSession.

When you enable debug mode in your config.php you can log to the console using traceVar() that can be helpful at times.

---
Menno Dekker
The following user(s) said Thank You: atlet

Please Log in to join the conversation.

More
3 years 6 months ago #98382 by atlet
If I put $this->setAuthPlugin(); this outside if statement, I get redirection loop.

Please Log in to join the conversation.

More
3 years 6 months ago #98388 by mdekker
Probably you have trouble detecting if someone is logged in. Try adding some debug statements to see what you have in the beforeLogin method (get, post, as->attributes etc.)

---
Menno Dekker

Please Log in to join the conversation.

More
3 years 6 months ago #98392 by atlet
Now I created simple plugin just for test if I can login: pastebin.com/08ycJBn9

User is admin...

If I did it right, I must be logged in when I go to LimeSurvey url : admin/authentication/sa/login?testlogin=1 but it doesn't work. I'm missing something?

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form