Hi @Michael Garfinkel ,
Thanks for using Microsoft Q&A !!
It looks like a scope issue. Instead of using client_id pass the URI of the web API scope like https://<your-tenant-name>.onmicrosoft.com/api/<scope>
.
Thanks
Saurabh
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Trying to pass a msal react (msal browser) access token to an authenticated api to ensure that the user is authenticated and has access to that api. I have been using msal-node to try to validate the access tokens but cant seem to find the right method to make sure the access token is valid and pull the user's attributes to make sure it has the right attributes.
tried acquireTokenByCode but get The provided JWE is not a valid 5 segment token.
const pca = new msal.ConfidentialClientApplication(publicClientConfig);
const response = await pca.acquireTokenByCode({
scopes: ['openid', '<client_id>'],
redirectUri: '<redirect_url>',
code: req.headers.token,
authority: '<authority_url>'
})
Any thoughts on how best to go about this?
using: msal-react v2, msal-node, user on azure ad b2c
Hi @Michael Garfinkel ,
Thanks for using Microsoft Q&A !!
It looks like a scope issue. Instead of using client_id pass the URI of the web API scope like https://<your-tenant-name>.onmicrosoft.com/api/<scope>
.
Thanks
Saurabh