Forum Discussion
dhaeseleermatthias
Jan 06, 2020Copper Contributor
Send an interactive authorization request for this user and resource.
Hi,
Trying to get an access token for an app registration using aadTokenProvider and getting this error.
Consented the registration multiple times in Azure itself and through the consent screen.
Keep getting this error:
Any help?
Code:
this.props.context.aadTokenProviderFactory.getTokenProvider().then((tokenProvider) => {
return tokenProvider.getToken('XXXXXXXX');
}).then((token: string) => {
alert(token);
}).catch(err => {
console.log(err);
});
- Rahul SuryawanshiBrass Contributor
Based on image you posted, it looks like your AD app is not consented by user or Admin on behalf of user. Admin can consent Azure AD app on behalf of user. Make sure your app is consented. If your app needs user consent, you can create user consent URI like below (replace appropriate tokens based on your Azure AD app registration)