From 12c4eb1e02428011ef6af53d6ede97e301997d12 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 10 May 2023 01:35:56 +0000 Subject: [PATCH] Bug 33708: Provide non-public endpoint for OAuth/OIDC for staff interface This change fixes the definition for the non-public endpoint for the OAuth/OIDC implementation. It also uses the non-public endpoint for the staff interface UI. Signed-off-by: David Cook Signed-off-by: Tomas Cohen Arazi (cherry picked from commit aae996e6bf1a981c1ab5700021593dac777f63ba) Signed-off-by: Matt Blenkinsop --- Koha/Template/Plugin/AuthClient.pm | 2 +- api/v1/swagger/swagger.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Koha/Template/Plugin/AuthClient.pm b/Koha/Template/Plugin/AuthClient.pm index db07509538..5646371bfa 100644 --- a/Koha/Template/Plugin/AuthClient.pm +++ b/Koha/Template/Plugin/AuthClient.pm @@ -50,7 +50,7 @@ sub get_providers { if $interface eq 'intranet'; my $providers = Koha::Auth::Identity::Providers->search( { "domains.allow_$interface" => 1 }, { prefetch => 'domains' } ); - my $base_url = ( $interface ne 'staff' ) ? "/api/v1/public/oauth/login" : "/api/v1/public/oauth/login"; + my $base_url = ( $interface eq 'staff' ) ? "/api/v1/oauth/login" : "/api/v1/public/oauth/login"; my @urls; diff --git a/api/v1/swagger/swagger.yaml b/api/v1/swagger/swagger.yaml index e7347f889b..c7a9a8bfbb 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -267,6 +267,8 @@ paths: $ref: ./paths/libraries.yaml#/~1libraries "/libraries/{library_id}": $ref: "./paths/libraries.yaml#/~1libraries~1{library_id}" + "/oauth/login/{provider_code}/{interface}": + $ref: ./paths/oauth.yaml#/~1oauth~1login~1{provider_code}~1{interface} /oauth/token: $ref: ./paths/oauth.yaml#/~1oauth~1token /patrons: -- 2.39.5