title: MSAL/ Microsoft Authorization problem with Angular: How to validate id_token?
body: <p>I'm trying to make an authorization through microsoft using MSAL Angular library. I configured environment in MS Azure, wrote a code...After logging in I get id_token, but I cannot validate it on graph.microsoft.com/v1.0/me as a Bearer. I get "InvalidAuthenticationToken" code. I searched through all stack and I still can't figure it out, even though there are some familiar threads. I want to make sure token is valid and get an email of user from response. This is my code:</p>
  
  <pre><code>@Injectable()
  export class MsalService {
  
    B2CTodoAccessTokenKey = 'b2c.access.token';
  
    tenantConfig = {
      tenant: 'censored.onmicrosoft.com',
      // Replace this with your client id
      clientID: 'censored',
      signInPolicy: 'B2C_1_signinsignup',
      signUpPolicy: 'B2C_1_signin',
      redirectUri: 'http://localhost:4200/auth/microsoft',
      b2cScopes: 
  ['https://censored.onmicrosoft.com/api/user_impersonation'],
      resource: 'https://graph.microsoft.com'
    };
  
    /*
     * B2C SignIn SignUp Policy Configuration
     */
    clientApplication = new Msal.UserAgentApplication(
      this.tenantConfig.clientID, this.authority,
      function(errorDesc: any, token: any, error: any, tokenType: any) {
      },
      {
        redirectUri: this.tenantConfig.redirectUri,
        navigateToLoginRequestUrl: false
      }
    );
  
    public login(): void {
      this.clientApplication.authority = 
  'https://login.microsoftonline.com/common';
      this.authenticate();
    }
  
    public authenticate(): void {
      var _this = this;
  
  
  
   this.clientApplication.loginPopup(this.tenantConfig.b2cScopes)
  .then(function(idToken: any) {
  
  _this.clientApplication.acquireTokenSilent(
  _this.tenantConfig.b2cScopes)
      .then(
          function(accessToken: any) {
            _this.saveAccessTokenToCache(accessToken);
          }, function(error: any) {
            _this.clientApplication.acquireTokenPopup(
  _this.tenantConfig.b2cScopes).then(
              function(accessToken: any) {
                _this.saveAccessTokenToCache(accessToken);
              }, function(error: any) {
                console.log('error: ', error);
              });
          });
      }, function(error: any) {
        console.log('error: ', error);
      });
    }
  </code></pre>