We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Use external authentication in EE

Development and Programming

cerias's avatar
cerias
4 posts
18 years ago
cerias's avatar cerias

I’m a little confused about how to authenticate against an external auth mechanism in EE. I’ve written an extension that uses the login_authenticate_start hook, and uses PEAR Auth to authenticate against an IMAP server. The authentication seems to go fine (I can trace through it with the Zend Debugger and Studio and see it work), but I just get popped back to the login screen instead of continuing to the CP – no error messages that would indicate another problem.

Basically, in my extension I duped the Login::authenticate method and the Login::login_form method (in cp.login.php) and altered the section in authenticate where the password comparison actually happens. Everything else is intact, so it checks for user bans and authorization for CP access and the like.

I suspect that there’s more that my extension has to take over, but I’m not sure what, exactly. Do I need to dupe the entirety of the Login class in my extension? If I’m doing that, is it possible to just extend the Login class similar to how we can extend core classes in CI? It seems like that would be simpler, allowing me to just redefine and edit the methods that actually handle authentication.

Any tips, even short ones, would be appreciated. I’ve attached the current extension in a ZIP archive.

       
Derek Allard's avatar
Derek Allard
3,168 posts
18 years ago
Derek Allard's avatar Derek Allard

I’ve moved this into the extension development forum for you, since it seems to be the most appropriate place. Good luck!

       
cerias's avatar
cerias
4 posts
18 years ago
cerias's avatar cerias

Actually, I think I’ve sorted out a method for accomplishing this. Basically, if the external authentication succeeds, I’m updating the internal EE user DB with a hash of a unique token generated by uniqid(). This lets EE do everything per normal, but doesn’t require that the “real” password be stored in any form within EE.

I’d be happy to share the source code if folks are interested.

(Edit: updated to include token creation info)

       
narration's avatar
narration
773 posts
18 years ago
narration's avatar narration

Sure, it would be interesting to see, cerias.

And thank you.

These forums have a lot of good things in them, resources for when you want to try something.

I think this authentication extension would be very good to have on record how to accomplish.

Kind regards, Clive

       
Tiger0516's avatar
Tiger0516
31 posts
about 18 years ago
Tiger0516's avatar Tiger0516

I have a similar question.

Could you please take a look at http://ellislab.com/forums/viewthread/57974/?

Thanks,

       
Jeremiah C.'s avatar
Jeremiah C.
8 posts
17 years ago
Jeremiah C.'s avatar Jeremiah C.

If you have the finalized source, I would love to see it. I’m trying to authenticate against an external source and am running into issues with every method that I’ve tried. Thanks!

       
Oxfam America's avatar
Oxfam America
3 posts
16 years ago
Oxfam America's avatar Oxfam America

I am about to start creating an external auth module - however if you have already done it - I’d love to have a look at the code

       
Chris Jennings's avatar
Chris Jennings
87 posts
16 years ago
Chris Jennings's avatar Chris Jennings

I could certainly make use of authenication through IMAP if you have something working. I would love to give it a try!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.