Bug 23146: Add support for Basic auth on the OAuth2 token endpoint
[koha-equinox.git] / Koha / REST / V1 / Auth.pm
index 5e505cb..8daa1ad 100644 (file)
@@ -71,7 +71,13 @@ sub under {
                 "Configuration prevents the usage of this endpoint by unprivileged users");
         }
 
-        $status = authenticate_api_request($c);
+        if ( $c->req->url->to_string eq '/api/v1/oauth/token' ) {
+            # Requesting a token shouldn't go through the API authenticaction chain
+            $status = 1;
+        }
+        else {
+            $status = authenticate_api_request($c);
+        }
 
     } catch {
         unless (blessed($_)) {