locked
Angular Azure AD - MsalModule. Get the Access Token after authentication RRS feed

  • Question

  • User956626884 posted

    HI,

    I just install MsalModule and followed the steps in https://www.npmjs.com/package/@azure/msal-angular.

    In my app.module.ts, I specified the MsalModule in the import section as followed

    MsalModule.forRoot({
    clientID: myClientId,
    authority: myAuthority,
    redirectUri: myReDirectUri,
    validateAuthority: true,
    cacheLocation: 'localstorage',
    postLogoutRedirectUri: myPostLogoutRedirectUri,

    popUp: false,
    level: LogLevel.Verbose,
    piiLoggingEnabled: true,
    })


    I also add the broadcast as followed

    this.loginSuccessSubscription = this.broadCastService.subscribe("msal:loginSuccess", (payload) => {

    alert("Login Success");
    });

    this.loginTokenSuccessSubscription = this.broadCastService.subscribe("msal:loginTokenSuccess", (payload) => {


    alert("Acquired Token");
    })


    After successfully authenticating to Azure, it redirect back to the web client. I hit F12 and see the id token but not the access token. I verified this by clicking F12, Network, Headers and don't see the access token.

    Visual Studio Code breaks on broadcast successful login but never on aquired token.

    How do I specified MsalServer to return the access token after authentication?

    Thanks.

    Friday, July 26, 2019 8:07 PM

Answers

All replies