Questions tagged msal-angular

Explore the latest questions and answers asked by our top developers.

angular msal v2 missing group claims

I’m looking to upgrade my angular app from MSAL v1 to MSAL v2, and one problem I have is the jwt token that the guard adds to requests does not include the group field in the payload anymore. We use group membership to decide who can access what so this is a big blocker of […]

By Kevin
Published
Categorized as angular, msal-angular Tagged ,

How to pass clientId in different environment to AppModule

I use msal to do authentication. In my AppModule.ts (from the example) @NgModule({ declarations: [ AppComponent, HomeComponent, ProfileComponent ], imports: [ BrowserModule, AppRoutingModule, MsalModule.forRoot( new PublicClientApplication({ auth: { clientId: ‘Enter_the_Application_Id_here’, // This is your client ID authority: ‘Enter_the_Cloud_Instance_Id_Here’/’Enter_the_Tenant_Info_Here’, // This is your tenant ID redirectUri: ‘Enter_the_Redirect_Uri_Here’// This is your redirect URI }, cache: { cacheLocation: […]

By Hello
Published
Categorized as angular, angular11, msal, msal-angular Tagged , , ,

Best way to handle msal redirect errors from the Msal2Provider in an angular project?

i am using the @microsoft/mgt libraries in order to use the Msal2Provider, people picker, and teams channel picker features. Everything is going great but I would like for our app to not crash if there ever is an error signing in to microsoft to retrieve the MSAL token using: Providers.globalProvider = new Msal2Provider({ clientId: ‘my-client-id’, […]

How to configure msal-angular interceptor to send an access token (v2) to own domain (self)

I updated to @azure/msal-angular v2 from v1. And I cannot figure out how to configure it to send an access token to my backend hosted on the same domain. So when my frontend makes a request to /api/foo then the MsalInterceptor should attach my access token in the version 2 format – not version 1. […]

MSAL Angular MsalGuard configuring logout

I am doing a POC on MSAL implementation on our Angular app. Requirements: The user has to login once a day. When he visits more than once, he is to be taken directly to the app with no login interaction. The auth flow is only required for authentication and not authorization (no need for access […]

By puterBoy
Published
Categorized as angular, msal, msal-angular, msal.js Tagged , , ,

MSAL Angular MsalGuard configuring local storage clear on token expiry

I am doing a POC on MSAL implementation on our Angular app. Requirements: The user has to login once a day. When he visits more than once, he is to be taken directly to the app with no login interaction. The auth flow is only required for authentication and not authorization (no need for access […]

By Senthamizh
Published
Categorized as angular, msal, msal-angular, msal.js Tagged , , ,

Get MSAL Interceptor Configuration from API

For a Static Web App (SPA) I have configured one endpoint /api/settings. This endpoint does not require authentication and returns a list of other endpoints that are needed in the application. Now the problem is, these endpoints returned by /api/settings do require authentication. In the code bellow, I need to configure protectedResourceMap with the response […]

By Vincent Bitter
Published
Categorized as angular, msal, msal-angular Tagged , ,

Is there a way to know when an msal redirect is in progress?

Im using the @azure/msal-browser and @azure/msal-angular packages in order to simply retrieve an MSAL token for my signed in users. Since all I really need is the token I have only provided the MsalService and MSAL_INSTANCE in my app.module.ts. I am using the redirect flow and have chosen to subscribe to the .handleRedirectObservable() method myself […]

By skyleguy
Published
Categorized as angular, azure, msal, msal-angular, redirect Tagged , , , ,

How to assign and use runtime config values in App.module in angular

I have a situation where i need to replace some of the hardcoded values with config.json values in the app.module. can we do that ? am able to add APP_INITIALIZER and useFactory and able to inject service in other components and that is working fine but not able to achieve with in app.module. I want […]

Dynamic configuration of MSAL 2 in Angular

For my Angular (v12) application, I use MSAL for Authentication and I’m facing an issue on configuration. In configuration, I have tenantId and app Id to initialize MSAL. I cannot use the standard Angular configuration switching with environment.ts since it cannot be changed in a post build step. Instead, I try to load a json […]

1 2 3

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq