From 448767712b9912f37a20da6b10a413cba0e5e53d Mon Sep 17 00:00:00 2001 From: Govindarajan Nagarajan Date: Thu, 30 Jul 2020 15:16:54 +0200 Subject: [PATCH] (auth-backend) Bugfix: Do not throw Exception if scopes dont exist. Refs #1786 Currently, the OAuthProvider library in `auth-backend` throws an Exception if scopes are missing in the `start` (initial) request in the Authorization flow. Scopes are an optional parameter as per the spec, so if scopes are empty, simply forward the empty scopes instead of throwing an Exception --- plugins/auth-backend/src/lib/OAuthProvider.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/auth-backend/src/lib/OAuthProvider.ts b/plugins/auth-backend/src/lib/OAuthProvider.ts index c4996c31a2..f9d85223a7 100644 --- a/plugins/auth-backend/src/lib/OAuthProvider.ts +++ b/plugins/auth-backend/src/lib/OAuthProvider.ts @@ -104,10 +104,6 @@ export class OAuthProvider implements AuthProviderRouteHandlers { // retrieve scopes from request const scope = req.query.scope?.toString() ?? ''; - if (!scope) { - throw new InputError('missing scope parameter'); - } - if (this.options.persistScopes) { this.setScopesCookie(res, scope); }