Scope are not supported while getting authCodeUrl with protocol mode OIDC

Rajan 0 Reputation points
2025-03-27T10:30:19.16+00:00

Application : Azure AD B2C

Library: MSAL Node

I am migrating from client secret to federated credential with AKS. Therefore, I have to change the default AAD protocol to OIDC.

        this.client = new ConfidentialClientApplication({
            auth: {
                clientId: configuration.clientId,
                authority: this.signInSignUpAuthority,
                knownAuthorities: [`https://${authorityDomain}`],
                protocolMode: `OIDC`,
                clientAssertion: `${clientAssertionValue}`
            }
        });

Unfortunaely, it does not work while getting AuthCodeUrl. I am stuck and did not find what is the problem here.

 result = await this.client.getAuthCodeUrl({
                authority: authority,
                redirectUri: this.configuration.baseRedirectUri + 'auth/' + ActionPathname.REDIRECT,
                scopes: this.configuration.scopes,
                codeChallenge: challenge,
                codeChallengeMethod: 'S256',
                state: state ?? undefined
            });

Both openid and offline_Access scopes are added to App in App registration.Screenshot 2025-03-27 at 11.27.33

error: invalid_request

**error_description:**AADB2C90012: The scope 'openid profile offline_access' provided in request is not supported.

state: {"target":"https://localhost:3000/","appStage":0}

0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.