Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

141
Vistas
How to reinitialise Angular app.module.ts providers after loading

I have a question on how to re-initialise Angular providers declared in the app.module.ts.

I'm trying to build an application based on the Microsoft MSAL 2.x Angular12 exemplar project that offers both B2B and B2C authentication flows. The Microsoft MSAL Angular exemplar uses HTTP_INTERCEPTORS and MSAL_INSTANCE which are created on initial application loading.

However, I want the web page that offers the user B2B or B2C login to be part of the single Angular application. But as per the Microsoft example, the providers are already instantiated on application startup.

How do I respond to the user selecting B2B or B2C which then defines which Azure Active Directory identity provider to authenticate the user?

The clientId for the Active Diretory configuration that should be variable is at line 50/51 of the app.module.ts file.

The user event that would trigger the defining of B2B or B2C is through the buttons defined on the app.component.html (and associated app.component.ts - line 65).

See Stackblitz at: https://stackblitz.com/edit/angular-ivy-e18xqa?file=src/app/app.module.ts

Any ideas or thoughts greatly appreciated.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda