-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClientID is not allowed in scopes. #4652
Comments
Do I understand correctly that you have a single app registration and you'd like to use it as both a client and a web api? Did you expose a web api in the app registration? Also, do you know from the Python app how the access token looks like? What is the "scp" (scopes) claim? |
Our case is hard to explain. We expect the OIDC token response to also include the access token, and the only way to achieve this in B2C is to include the client ID in the authorization request scope. When using {
"access_token": "eyJhbGciOiJSUz...",
"id_token": "eyJhbGciOiJSUzI1N...",
"token_type": "Bearer",
"not_before": 1709296392,
"expires_in": 3600,
"expires_on": 1709299992,
"resource": "73c4acd4-xxxx-xxxx-xxxx-fd0657497f57",
"id_token_expires_in": 3600,
"profile_info": "eyJ2ZXIiOi",
"scope": "73c4acd4-xxxx-xxxx-xxxx-fd0657497f57 openid"
} The decoded access token has no "scp" (scopes) claim. |
We tried this. We created a separate application registration named Then, in the API Permissions of the OIDC application registration, we added the In the OIDC authorization request, we set the scopes to If we remove
This doesn't matter, we just want to get both the ID token and the access token in the OIDC token exchange request and we can't send a separate token exchange request to get the access token due to the current architecture limits. |
Please help me understand what you mean by "OIDC" request, because there are 2 requests involved: one for the authorization endpoint and one for the token endpoint.
In both requests the scopes should be Are you saying that requesting |
Yes, that's it. It won't return the access token, you could try it with the B2C login. Whereas using the client ID as the scope, will return the access token, so we added the client ID, but this library doesn't allow this. |
Overall, I would suggest that, |
@rayluo thanks for the summary, you got my point. |
Fixed in MSAL.Net 4.60.0 release |
Hi,
We are using the B2C OIDC. The B2C login needs to pass the Client ID to return the access token, which is not allowed explicitly in this library.
From the picture, I understand that we can pass the Client ID as the scope when using B2C OIDC.
microsoft-authentication-library-for-dotnet/src/client/Microsoft.Identity.Client/Internal/Requests/RequestBase.cs
Lines 68 to 74 in a98bcf7
The same library for Python has been fixed in AzureAD/microsoft-authentication-library-for-python#530
Related issues: #2372
The text was updated successfully, but these errors were encountered: