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

353
Views
MSAL login not working in production for node.js , Javascript application

I have used Msal.js for login to microsoft account inorder to call microsoft graph api. On local everything is working fine but after deployment on production, login is happening but again a login popup is opening up , and my web application is not redirected to home page.

My redirect uri is : "http://localhost:8080/"

I am using node.js to create the localhost server.

My config.js file is -

const msalConfig = {
    auth: {
      clientId: 'cbd4ec69-c747-4592-ae78-7d8d680d0428',
      redirectUri: 'http://localhost:8080/'
    }
  };
  
  const msalRequest = {
    scopes: [
        'user.read',
      'Files.Read',
       'Files.Read.All',
        'Files.ReadWrite',
         'Files.ReadWrite.All'
    ]
  }

I need to deploy my application on prod, i have made the whole application and now only this thing is not working.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

One of the workaround we can follow to resolve the above issue,

Make sure that the port you are using its been updated in server.js with your preferred port number in redirect uri.

We can follow the below given MS DOC and use the sample code.

The sample code will work like, When a user initially clicks the Sign In button, the signIn method invokes the loginPopup function to sign the user in. The loginPopup method prompts and validates the user's credentials by opening a pop-up window with the Microsoft identity platform endpoint. Msal.js starts the authorization code flow after a successful sign-in.

For complete setup please refer this MICROSOFT DOCUMENTATION|Sign in users and call the Microsoft Graph API from a JavaScript .

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!