Merge pull request #22848 from gusevda/enable-persisted-scopes

Enable persisted scopes for OIDC authenticator
This commit is contained in:
Patrik Oldsberg
2024-02-13 13:23:57 +01:00
committed by GitHub
2 changed files with 6 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend-module-oidc-provider': patch
---
Fixed a bug where the OIDC authenticator did not properly persist granted OAuth scopes.
@@ -42,6 +42,7 @@ export type OidcAuthResult = {
/** @public */
export const oidcAuthenticator = createOAuthAuthenticator({
shouldPersistScopes: true,
defaultProfileTransform: async (
input: OAuthAuthenticatorResult<OidcAuthResult>,
) => ({
@@ -162,9 +163,6 @@ export const oidcAuthenticator = createOAuthAuthenticator({
if (!tokenset.access_token) {
throw new Error('Refresh failed');
}
if (!tokenset.scope) {
tokenset.scope = input.scope;
}
const userinfo = await client.userinfo(tokenset.access_token);
return new Promise((resolve, reject) => {