From 5d32a58b5a13b0dbf6da5401cb1005554d1b6be3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Mon, 25 Sep 2023 12:10:46 +0200 Subject: [PATCH] auth-backend-module-github-provider: enable persisted scopes Signed-off-by: Patrik Oldsberg --- .changeset/nice-dancers-explain.md | 5 +++++ .../auth-backend-module-github-provider/src/authenticator.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/nice-dancers-explain.md diff --git a/.changeset/nice-dancers-explain.md b/.changeset/nice-dancers-explain.md new file mode 100644 index 0000000000..5e54a66c05 --- /dev/null +++ b/.changeset/nice-dancers-explain.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend-module-github-provider': patch +--- + +Fixed a bug where the GitHub authenticator did not properly persist granted OAuth scopes. diff --git a/plugins/auth-backend-module-github-provider/src/authenticator.ts b/plugins/auth-backend-module-github-provider/src/authenticator.ts index f59ac3d727..4a9710d114 100644 --- a/plugins/auth-backend-module-github-provider/src/authenticator.ts +++ b/plugins/auth-backend-module-github-provider/src/authenticator.ts @@ -28,6 +28,7 @@ const ACCESS_TOKEN_PREFIX = 'access-token.'; export const githubAuthenticator = createOAuthAuthenticator({ defaultProfileTransform: PassportOAuthAuthenticatorHelper.defaultProfileTransform, + shouldPersistScopes: true, initialize({ callbackUrl, config }) { const clientId = config.getString('clientId'); const clientSecret = config.getString('clientSecret');