Send an interactive authorization request for this user and resource.

Copper Contributor

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:

 

clipboard_image_0.png

 

Any help?

 

Code:

 

 

    this.props.context.aadTokenProviderFactory.getTokenProvider().then((tokenProvider) => {
      return tokenProvider.getToken('XXXXXXXX');
    }).then((token: string) => {
      alert(token);
    }).catch(err => {
      console.log(err);
    });

 

2 Replies

@dhaeseleermatthias 

 

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)

 

https://login.microsoftonline.com/<tenant_ID>/oauth2/v2.0/authorize?client_id=<Client_ID>&response_t...