Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

66
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda