From aae996e6bf1a981c1ab5700021593dac777f63ba 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 --- 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 23c59b96a1..280610c261 100644 --- a/api/v1/swagger/swagger.yaml +++ b/api/v1/swagger/swagger.yaml @@ -281,6 +281,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