Bug 12547

Summary: Create better API for handling external authentication
Product: Koha Reporter: David Cook <dcook>
Component: AuthenticationAssignee: Galen Charlton <gmcharlt>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: dpavlin, martin.renvoize
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=3237
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8446
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12548
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:

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 :).
Comment 6 David Cook 2020-12-23 04:57:08 UTC
This is a vague report. It's better to open a bug report for a specific enhancement to authentication like Bug 21586.