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

67
Vistas
Dependency inject MSAL Javascript library

I am working with a development team that is leveraging Microsoft's MSAL.js library for a vanilla javascript application. The authConfig.js has the following necessary code:

const msalConfig = {
auth: {
  clientId: "11111111-1111-1111-111111111111",
  authority: "https://login.microsoftonline.com/11111111-1111-1111-1111111111111",
  redirectUri: "http://localhost:3000/",
},
cache: {
  cacheLocation: "sessionStorage", // This configures where your cache will be stored
  storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge
}

I need to be able to change the clientId and RedirectURI for Dev, QA and Prod. Is there a way to dependency inject these values for the DevOps pipeline?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Is there a way to dependency inject these values for the DevOps pipeline?

I would like to share the following two methods:

Method1:

You can add PowerShell task in each stage to replace the value of ClientId and redirectUri.

1.Set the variable to save the Old value and New Value. enter image description here

2.Run the following Powershell script:

(Get-Content  .\authConfig.js).replace('$(oldid)', '$(newid)') | Set-Content  .\authConfig.js

(Get-Content  .\authConfig.js).replace('$(oldredirectUri)', '$(newredirectUri)') | Set-Content  .\authConfig.js

Method2 :

You could try to use the Replace Tokens task from the Replace Tokens Extension.

For more info, you can refer to this ticket: Replace token task ticket

about 4 years ago · Juan Pablo Isaza Denunciar
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