Description
Fridolin Somers
2013-11-08 10:11:54 UTC
Created attachment 22807 [details] [review] Bug 11219 - CAS authentication fails with URL parameters See commit message Patch tested with a sandbox, by Koha team AMU <koha.aixmarseille@gmail.com> Created attachment 23138 [details] [review] Bug 11219 - CAS authentication fails with URL parameters Bug 10029 tries to fix the use of URL parameters in CAS authentication. But is does not work. The full URL must be used in all methods of C4::Auth_with_cas. Also, in checkpw_cas(), the 'ticket' parameter must be removed to find the original URL. This patch removes the 'ticket' parameter from query before calling checkpw_cas() since the ticket is passed as method arguemnt. In C4::Auth_with_cas, many methods use the same code to get the CAS handler and the service URI. This patch adds a private method _get_cas_and_service() to do the job. Test plan : Test plan : - Enable CAS - Go to opac without been logged-in - Try to place hold on a record => You get to /cgi-bin/koha/opac-reserve.pl?biblionumber=XXX showing authentication page => Check that CAS link contains query param "biblionumber" - Click on CAS link and log in => Check you return well logged-in to reserve page with biblionumber param - Check CAS loggout - Check Proxy CAS auth Signed-off-by: Koha team AMU <koha.aixmarseille@gmail.com> Hi Fridolin and Team AMU, is there a way to test this without a working CAS environment? (In reply to Katrin Fischer from comment #4) > Hi Fridolin and Team AMU, > is there a way to test this without a working CAS environment? I don't know. But I'd say same has Bug 10029. Created attachment 23744 [details] [review] [PASSED QA] Bug 11219 - CAS authentication fails with URL parameters Bug 10029 tries to fix the use of URL parameters in CAS authentication. But is does not work. The full URL must be used in all methods of C4::Auth_with_cas. Also, in checkpw_cas(), the 'ticket' parameter must be removed to find the original URL. This patch removes the 'ticket' parameter from query before calling checkpw_cas() since the ticket is passed as method arguemnt. In C4::Auth_with_cas, many methods use the same code to get the CAS handler and the service URI. This patch adds a private method _get_cas_and_service() to do the job. Test plan: - Enable CAS - Go to opac without been logged-in - Try to place hold on a record => You get to /cgi-bin/koha/opac-reserve.pl?biblionumber=XXX showing authentication page => Check that CAS link contains query param "biblionumber" - Click on CAS link and log in => Check you return well logged-in to reserve page with biblionumber param - Check CAS loggout - Check Proxy CAS auth Signed-off-by: Koha team AMU <koha.aixmarseille@gmail.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests in t, xt, and t/db_dependent/Auth.t. Also passes QA script. As I have no working CAS server, I focused on regression testing: Activated Persona and casAuthentication. - Verified normal login against database still works. - Verified Persona login works. Note: With Persona you are always forwarded to the patron account - so you have to search for the record again before you can place a hold. - Verified that the CAS URL contains the biblionumber when logging in while placing a hold. Created attachment 26967 [details] [review] Bug 11219 - Bug 11219 - CAS authentication fails with URL parameters - followup This followup corrects the fact that when using $query->url(), both GET and POST params are get. Using $query->url_param() will only get params directly in URL. Test plan : - Enable CAS - Go to login page : cgi-bin/koha/opac-user.pl - Try to connect with local login using random login and password (they will be transmitted by POST) - You stay to login page - Look at CAS login URL => Without this patch it will contain the random login and password as parameters of opac-user.pl => With this patch it does not contain any parameter Created attachment 26971 [details] [review] signed patch I set as critical because it may show a user/password Created attachment 27054 [details] [review] [PASSED QA] Bug 11219 - CAS authentication fails with URL parameters Bug 10029 tries to fix the use of URL parameters in CAS authentication. But is does not work. The full URL must be used in all methods of C4::Auth_with_cas. Also, in checkpw_cas(), the 'ticket' parameter must be removed to find the original URL. This patch removes the 'ticket' parameter from query before calling checkpw_cas() since the ticket is passed as method arguemnt. In C4::Auth_with_cas, many methods use the same code to get the CAS handler and the service URI. This patch adds a private method _get_cas_and_service() to do the job. Test plan: - Enable CAS - Go to opac without been logged-in - Try to place hold on a record => You get to /cgi-bin/koha/opac-reserve.pl?biblionumber=XXX showing authentication page => Check that CAS link contains query param "biblionumber" - Click on CAS link and log in => Check you return well logged-in to reserve page with biblionumber param - Check CAS loggout - Check Proxy CAS auth Signed-off-by: Koha team AMU <koha.aixmarseille@gmail.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests in t, xt, and t/db_dependent/Auth.t. Also passes QA script. As I have no working CAS server, I focused on regression testing: Activated Persona and casAuthentication. - Verified normal login against database still works. - Verified Persona login works. Note: With Persona you are always forwarded to the patron account - so you have to search for the record again before you can place a hold. - Verified that the CAS URL contains the biblionumber when logging in while placing a hold. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Retested 2014-04-12 First patch is PQA, I signed off on the second patch. Created attachment 27055 [details] [review] [SIGNED OFF] Bug 11219 - CAS authentication fails with URL parameters - followup This followup corrects the fact that when using $query->url(), both GET and POST params are get. Using $query->url_param() will only get params directly in URL. Test plan : - Enable CAS - Go to login page : cgi-bin/koha/opac-user.pl - Try to connect with local login using random login and password (they will be transmitted by POST) - You stay to login page - Look at CAS login URL => Without this patch it will contain the random login and password as parameters of opac-user.pl => With this patch it does not contain any parameter Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Created attachment 27095 [details] [review] Bug 11219 - CAS authentication fails with URL parameters Bug 10029 tries to fix the use of URL parameters in CAS authentication. But is does not work. The full URL must be used in all methods of C4::Auth_with_cas. Also, in checkpw_cas(), the 'ticket' parameter must be removed to find the original URL. This patch removes the 'ticket' parameter from query before calling checkpw_cas() since the ticket is passed as method arguemnt. In C4::Auth_with_cas, many methods use the same code to get the CAS handler and the service URI. This patch adds a private method _get_cas_and_service() to do the job. Test plan: - Enable CAS - Go to opac without been logged-in - Try to place hold on a record => You get to /cgi-bin/koha/opac-reserve.pl?biblionumber=XXX showing authentication page => Check that CAS link contains query param "biblionumber" - Click on CAS link and log in => Check you return well logged-in to reserve page with biblionumber param - Check CAS loggout - Check Proxy CAS auth Signed-off-by: Koha team AMU <koha.aixmarseille@gmail.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests in t, xt, and t/db_dependent/Auth.t. Also passes QA script. As I have no working CAS server, I focused on regression testing: Activated Persona and casAuthentication. - Verified normal login against database still works. - Verified Persona login works. Note: With Persona you are always forwarded to the patron account - so you have to search for the record again before you can place a hold. - Verified that the CAS URL contains the biblionumber when logging in while placing a hold. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Retested 2014-04-12 Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 27096 [details] [review] Bug 11219 - CAS authentication fails with URL parameters - followup This followup corrects the fact that when using $query->url(), both GET and POST params are get. Using $query->url_param() will only get params directly in URL. Test plan : - Enable CAS - Go to login page : cgi-bin/koha/opac-user.pl - Try to connect with local login using random login and password (they will be transmitted by POST) - You stay to login page - Look at CAS login URL => Without this patch it will contain the random login and password as parameters of opac-user.pl => With this patch it does not contain any parameter Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Pushed to master. Thanks, Fridolin! Pushed to 3.14.x, will be in 3.14.10 (In reply to Galen Charlton from comment #15) > Pushed to master. Thanks, Fridolin! Patch already added to 3.16.x branch |