Merge pull request #20573 from markussiebert/fix/oidc-refresh-no-token

auth-backend(oidc-provider): Use requested scope if the refresh token request response has none
This commit is contained in:
Patrik Oldsberg
2023-10-16 20:44:24 +02:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': patch
---
Fixed bug in oidc refresh handler, if token endpoints response on refresh request does not contain a scope, the requested scope is used.
@@ -130,6 +130,9 @@ export class OidcAuthProvider implements OAuthHandlers {
if (!tokenset.access_token) {
throw new Error('Refresh failed');
}
if (!tokenset.scope) {
tokenset.scope = req.scope;
}
const userinfo = await client.userinfo(tokenset.access_token);
return {