Bug 12547 - Create better API for handling external authentication
Summary: Create better API for handling external authentication
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Authentication (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Target Milestone: ---
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-10 02:35 UTC by David Cook
Modified: 2015-01-01 22:16 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2014-07-10 02:35:30 UTC
At the moment, authentication is really handled all that consistently.

There is Auth_with_cas.pm, Auth_with_ldap.pm, and perhaps one day Auth_with_Shibboleth.pm.

There is also Persona which relies on a DOM API and Javascript on some OPAC pages. 

All of these different methods also hook into Auth.pm.

They all work but it's not really that easy to see how they work nor is it straightforward to add new forms of external authentication.

I don't have a plan of how to improve C4::Auth::checkauth() or C4::Auth, but I think it's worth thinking about. 

Obviously, it would require a ton of testing, but perhaps we could have incremental improvements.
Comment 1 David Cook 2014-07-10 02:59:55 UTC
"At the moment, authentication isn't really handled all that consistently"*

It's also not documented very well, but I'll create a new bug for that...
Comment 2 David Cook 2014-07-10 03:35:02 UTC
(In reply to David Cook from comment #1)
> "At the moment, authentication isn't really handled all that consistently"*
> 
> It's also not documented very well, but I'll create a new bug for that...

http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12548
Comment 3 David Cook 2014-07-10 04:01:19 UTC
(In reply to David Cook from comment #2)
> (In reply to David Cook from comment #1)
> > "At the moment, authentication isn't really handled all that consistently"*
> > 
> > It's also not documented very well, but I'll create a new bug for that...
> 
> http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12548

Actually, the more I review C4::Auth::checkauth(), maybe more in-line documentation and better indenting is all that is required at the moment... it probably would be a good idea to switch to Koha::Auth at some point, but a good first step would be to get a better handle on the existing situation, I think...
Comment 4 Martin Renvoize 2014-12-31 07:16:51 UTC
I am slowly on the case here.. starting with a non-destructive tidy of the code found in bug 13499.

The aim is to Tidy -> Document -> Write Tests -> Refactor -> Rewrite over a long period... even if I only get steps one and two done I'd be pretty happy that we're moving forward.

Fancy verifying that my tidy actually improves things and maintain git blame history David?
Comment 5 David Cook 2015-01-01 22:16:53 UTC
(In reply to Martin Renvoize from comment #4)
> I am slowly on the case here.. starting with a non-destructive tidy of the
> code found in bug 13499.
> 
> The aim is to Tidy -> Document -> Write Tests -> Refactor -> Rewrite over a
> long period... even if I only get steps one and two done I'd be pretty happy
> that we're moving forward.
> 
> Fancy verifying that my tidy actually improves things and maintain git blame
> history David?

It's been a while now since I've looked at the C4::Auth code, but I'll do my best when I can to check it out :).