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

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

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