diff --git a/.changeset/stale-rats-tease.md b/.changeset/stale-rats-tease.md new file mode 100644 index 0000000000..3564742cc6 --- /dev/null +++ b/.changeset/stale-rats-tease.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend-module-google-provider': patch +--- + +Pass through `includeGrantedScopes` in order to persist scopes across refresh calls diff --git a/plugins/auth-backend-module-google-provider/src/authenticator.ts b/plugins/auth-backend-module-google-provider/src/authenticator.ts index 9f1e298ae8..b0c58b777b 100644 --- a/plugins/auth-backend-module-google-provider/src/authenticator.ts +++ b/plugins/auth-backend-module-google-provider/src/authenticator.ts @@ -73,6 +73,7 @@ export const googleAuthenticator = createOAuthAuthenticator({ return helper.start(input, { accessType: 'offline', prompt: 'consent', + includeGrantedScopes: 'true', }); }, diff --git a/plugins/auth-backend-module-google-provider/src/module.test.ts b/plugins/auth-backend-module-google-provider/src/module.test.ts index 8ece0c1942..608428d9f5 100644 --- a/plugins/auth-backend-module-google-provider/src/module.test.ts +++ b/plugins/auth-backend-module-google-provider/src/module.test.ts @@ -67,6 +67,7 @@ describe('authModuleGoogleProvider', () => { prompt: 'consent', response_type: 'code', client_id: 'my-client-id', + include_granted_scopes: 'true', redirect_uri: `http://localhost:${server.port()}/api/auth/google/handler/frame`, state: expect.any(String), scope: