diff --git a/.changeset/eight-oranges-wave.md b/.changeset/eight-oranges-wave.md new file mode 100644 index 0000000000..cc363178c2 --- /dev/null +++ b/.changeset/eight-oranges-wave.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-auth-node': patch +--- + +Fix error when Microsoft tokens (or any other using the `defaultProfileTransform`) are requested without the profile scope. diff --git a/plugins/auth-node/src/oauth/PassportOAuthAuthenticatorHelper.ts b/plugins/auth-node/src/oauth/PassportOAuthAuthenticatorHelper.ts index 420a661da5..c03a9cb56f 100644 --- a/plugins/auth-node/src/oauth/PassportOAuthAuthenticatorHelper.ts +++ b/plugins/auth-node/src/oauth/PassportOAuthAuthenticatorHelper.ts @@ -57,7 +57,7 @@ export class PassportOAuthAuthenticatorHelper { OAuthAuthenticatorResult > = async input => ({ profile: PassportHelpers.transformProfile( - input.fullProfile, + input.fullProfile ?? {}, input.session.idToken, ), });