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

492
Visualizações
Keycloak-js 'init()' not executing in React app

When I access my app, my Keycloak config is passed to the .init() function to initialize however when I do this, the app stalls and nothing renders on the page, I am not redirected to the keycloak page. The following method is called within index.js before anything is rendered and App should only render upon authentication

const initKeycloak = (onAuthenticatedCallback) => {
  _kc.init({
    onLoad: 'check-sso',
    silentCheckSsoRedirectUri: window.location.origin + '/silent-check-sso.html',
    pkceMethod: 'S256',
  })
    .then((authenticated) => {
      if (!authenticated) {
        doLogin();
      }
      onAuthenticatedCallback();
    })
    .catch(console.error);
};

When I run, nothing loads and the following is repeated over and over in the logs: [HMR] Waiting for update signal from WDS.... I am unable to reach the .then() part of the function. If i remove the auth code, page renders as normal.

NOTE: The keycloak server I am using is a deployed instance and not a local instance. I have checked versions of both keycloak server and keycloak-js and they match

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Add this :

<html>
   <body>
      <script>parent.postMessage(location.href, location.origin)</script>
   </body>
</html>

in your silent-check-sso.html

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