Jan 06 2020 12:33 AM
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);
});
Jan 07 2020 09:56 AM
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)