Bug 19373 - CAS login for staff interface always goes back to home
Summary: CAS login for staff interface always goes back to home
Status: Pushed to Master
Alias: None
Product: Koha
Classification: Unclassified
Component: Authentication (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Whiteboard:
Keywords:
Depends on: 13507
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-27 14:13 UTC by Gwendal JONCOUR
Modified: 2017-11-28 07:26 UTC (History)
5 users (show)

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


Attachments
Bug 19373: CAS logout - Redirect to the previous page (Intranet) (1.05 KB, patch)
2017-09-27 16:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19373: Update tests (1.03 KB, patch)
2017-10-11 15:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19373: Update tests (1.09 KB, patch)
2017-10-13 14:11 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 19373: CAS logout - Redirect to the previous page (Intranet) (1.11 KB, patch)
2017-10-13 14:11 UTC, Matthias Meusburger
Details | Diff | Splinter Review
Bug 19373: Update tests (1.19 KB, patch)
2017-10-16 06:54 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 19373: CAS logout - Redirect to the previous page (Intranet) (1.21 KB, patch)
2017-10-16 06:54 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Gwendal JONCOUR 2017-09-27 14:13:49 UTC
When I'm disconnected from the staff interface for inactivity, I noticed that CAS login always go back to homepage while local login sends me to the correct page (for example a borrower page). 

When I checked the CAS login URL, I see that the service part is composed of the base url followed-up directly by the query part of the page. The script part is absent. Then, I checked C4/Auth_with_cas.pm and see in the sub _url_with_get_params that get_script_name() is only called for the OPAC login.

Is there a specific reason for that or can we call get_script_name() for both context ?
Comment 1 Jonathan Druart 2017-09-27 16:53:57 UTC
I guess it is an oversight, this behaviour exists since bug 13507.
Comment 2 Jonathan Druart 2017-09-27 16:58:45 UTC
Created attachment 67405 [details] [review]
Bug 19373: CAS logout - Redirect to the previous page (Intranet)
Comment 3 Jonathan Druart 2017-09-27 16:59:00 UTC
I have not tested this patch.
Comment 4 Gwendal JONCOUR 2017-10-10 14:49:06 UTC
Tested on our 16.11 preproduction version and it works pretty good.
Comment 5 Marcel de Rooy 2017-10-11 12:27:47 UTC
not ok 4 - Intranet URL should be returned when using intranet login (Bug 13507)
#   Failed test 'Intranet URL should be returned when using intranet login (Bug 13507)'
#   at t/db_dependent/Auth_with_cas.t line 62.
#          got: 'localhost:8080/cgi-bin/koha/opac-user.pl?bar=baz'
#     expected: 'localhost:8080?bar=baz'
Comment 6 Jonathan Druart 2017-10-11 15:15:38 UTC
Created attachment 67963 [details] [review]
Bug 19373: Update tests
Comment 7 Jonathan Druart 2017-10-11 15:16:34 UTC
Matts, could you take a look at these changes?
Comment 8 Matthias Meusburger 2017-10-13 14:06:24 UTC
I'm ok with this patch, and I successfully tested it on my local instance with BibLibre's CAS Test server.

I'm signing it off.
Comment 9 Matthias Meusburger 2017-10-13 14:11:26 UTC
Created attachment 68077 [details] [review]
Bug 19373: Update tests

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 10 Matthias Meusburger 2017-10-13 14:11:56 UTC
Created attachment 68078 [details] [review]
Bug 19373: CAS logout - Redirect to the previous page (Intranet)

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Comment 11 Marcel de Rooy 2017-10-16 06:54:44 UTC
Created attachment 68171 [details] [review]
Bug 19373: Update tests

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Marcel de Rooy 2017-10-16 06:54:49 UTC
Created attachment 68172 [details] [review]
Bug 19373: CAS logout - Redirect to the previous page (Intranet)

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Jonathan Druart 2017-10-16 13:01:27 UTC
Pushed to master for 17.11, thanks to everybody involved!