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

355
Vistas
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 Respuestas
Responde la pregunta

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 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