Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

65
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!