Bugzilla – Attachment 169908 Details for
Bug 37318
Connexion Client cannot authenticate due to CSRF
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37318: Use svc/authentication for Connexion daemon
Bug-37318-Use-svcauthentication-for-Connexion-daem.patch (text/plain), 1.86 KB, created by
Eric Garcia
on 2024-07-31 17:56:46 UTC
(
hide
)
Description:
Bug 37318: Use svc/authentication for Connexion daemon
Filename:
MIME Type:
Creator:
Eric Garcia
Created:
2024-07-31 17:56:46 UTC
Size:
1.86 KB
patch
obsolete
>From 96d65b463a6645ecc788c7483502d0f649ab6f1c Mon Sep 17 00:00:00 2001 >From: Eric Garcia <cubingguy714@gmail.com> >Date: Wed, 31 Jul 2024 17:55:41 +0000 >Subject: [PATCH] Bug 37318: Use svc/authentication for Connexion daemon > >--- > misc/bin/connexion_import_daemon.pl | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > >diff --git a/misc/bin/connexion_import_daemon.pl b/misc/bin/connexion_import_daemon.pl >index 40bff5d965..0d40a2ff0b 100755 >--- a/misc/bin/connexion_import_daemon.pl >+++ b/misc/bin/connexion_import_daemon.pl >@@ -104,7 +104,7 @@ use MARC::File::XML; > > use constant CLIENT_READ_TIMEOUT => 5; > use constant CLIENT_READ_BUFFER_SIZE => 100000; >-use constant AUTH_URI => "/cgi-bin/koha/mainpage.pl"; >+use constant AUTH_URI => "/cgi-bin/koha/svc/authentication"; > use constant IMPORT_SVC_URI => "/cgi-bin/koha/svc/import_bib"; > > sub new { >@@ -373,7 +373,15 @@ sub handle_request { > if ( $status == HTTP_UNAUTHORIZED || $status == HTTP_FORBIDDEN ) { > my $user = $self->{user}; > my $password = $self->{password}; >- $resp = $ua->post( $base_url . AUTH_URI, { userid => $user, password => $password } ); >+ >+ $resp = $ua->get( $base_url . AUTH_URI ); >+ my $csrf_token = $resp->header('CSRF-TOKEN'); >+ $resp = $ua->post( $base_url . AUTH_URI, { >+ userid => $user, >+ password => $password, >+ csrf_token => $csrf_token >+ }); >+ > $resp = $ua->post( > $base_url . IMPORT_SVC_URI, > { >@@ -388,7 +396,7 @@ sub handle_request { > } > ) if $resp->is_success; > } >- unless ($resp->is_success) { >+ unless ($resp->is_success) { > $self->log("Unsuccessful request", $resp->request->as_string, $resp->as_string); > return $self->error_response("Unsuccessful request"); > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37318
:
169908
|
169909