Skip to content
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

While using MSAL-Angular and requesting an access_token for Azure Active Directory graph api, it gives token with aud of Microsoft graph api #18

Open
ghost opened this issue Mar 13, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 13, 2019

When set the protectedResourceMap as Azure Active Directory graph api, it should give token with aud 'https://graph.windows.net/', but instead it gives token with aud 'https://graph.microsoft.com'.

Actual behavior
When set the protectedResourceMap as Azure Active Directory graph api, it should give token with aud 'https://graph.windows.net/', but instead it gives token with aud 'https://graph.microsoft.com'.

Also when i use this token with actual Azure Active Directory graph api call, it gives error of Token expired.

using below typescript code to get the token ;

public async getAccessToken(endpointUri: string): Promise {

this.accessToken = '';
const scopes = this.msalService.getScopesForEndpoint(endpointUri);

return new Promise((resolve, reject) => {
this.msalService.acquireTokenSilent(scopes)

.then(accessToken => {
  this.accessToken = accessToken;
  resolve(true);
  // tslint:disable-next-line: promise-function-async
}).catch(() => {

  return this.msalService.acquireTokenPopup(scopes)
    .then(token => {

      this.accessToken = token;
      resolve(true);

    })
    .catch((error) => {
      reject(new Error(error));
    });
});

});
}

@benbaran
Copy link
Owner

benbaran commented Mar 15, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant