diff --git a/.changeset/eleven-pianos-fail.md b/.changeset/eleven-pianos-fail.md new file mode 100644 index 0000000000..5b0aa76ae9 --- /dev/null +++ b/.changeset/eleven-pianos-fail.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-backend': patch +--- + +Fixed bug on refresh token on Okta provider, now it gets the refresh token and it sends it into providerInfo diff --git a/plugins/auth-backend/src/providers/okta/provider.ts b/plugins/auth-backend/src/providers/okta/provider.ts index dfffca9da7..69bbbd8c84 100644 --- a/plugins/auth-backend/src/providers/okta/provider.ts +++ b/plugins/auth-backend/src/providers/okta/provider.ts @@ -148,11 +148,12 @@ export class OktaAuthProvider implements OAuthHandlers { } async refresh(req: OAuthRefreshRequest): Promise { - const { accessToken, params } = await executeRefreshTokenStrategy( - this._strategy, - req.refreshToken, - req.scope, - ); + const { accessToken, refreshToken, params } = + await executeRefreshTokenStrategy( + this._strategy, + req.refreshToken, + req.scope, + ); const fullProfile = await executeFetchUserProfileStrategy( this._strategy, @@ -163,7 +164,7 @@ export class OktaAuthProvider implements OAuthHandlers { fullProfile, params, accessToken, - refreshToken: req.refreshToken, + refreshToken, }); } @@ -176,6 +177,7 @@ export class OktaAuthProvider implements OAuthHandlers { accessToken: result.accessToken, scope: result.params.scope, expiresInSeconds: result.params.expires_in, + refreshToken: result.refreshToken, }, profile, };