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

2K
Visualizações
Keycloak - MediaType not set on path

In Keycloak (Server Version 12.0.1), when I try to reach a realm login page, these errors are triggered:

09:44:04,737 ERROR [org.keycloak.headers.DefaultSecurityHeadersProvider] (default task-1) MediaType not set on path /auth/realms/<realm-name>/protocol/openid-connect/auth, with response status 500

09:44:04,738 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /auth/realms/<realm-name>/protocol/openid-connect/auth: java.lang.RuntimeException: java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error

This is the URL generated clicking on Login button on web page (Angular ):

https://auth.<project-name>.local:5001/auth/realms/<realm-name>/protocol/openid-connect/auth?response_type=code&client_id=<client-id>&state=MWl1SkQwNE1vaXZ1LXdLVGh6MWhvZGJiVldPVy40RTJwU2pVfmZ5ZzhsTmRZ&redirect_uri=http%3A%2F%2F<realm-name>%3A4288%2F&scope=openid%20profile%20email%20offline_access%20<clientId>&code_challenge=OPHLi0y4cM0BtILP12xVwUH8p_SiJZjZx1c_ehsFwB4&code_challenge_method=S256&nonce=MWl1SkQwNE1vaXZ1LXdLVGh6MWhvZGJiVldPVy40RTJwU2pVfmZ5ZzhsTmRZ

Angular project

auth.service.ts

public configure() {
authConfig.issuer = this.settingsService.getBaseAuthUrl()}auth/realms/${this._window.location.hostname.split('.')[0]}`;
`this.oauthService.configure(authConfig);

auth.config.ts

export const authConfig: AuthConfig = {
 
  // skipIssuerCheck: null,
  // Url of the Identity Provider
  // issuer: `${authUrl}auth/realms/master`,

  redirectUri: document.getElementsByTagName('base')[0].href as string,

  
  clientId: '<clientId>',
  
  scope: 'openid profile email offline_access <clientId>',

  requireHttps: true,

  showDebugInformation: true,

  responseType: 'code',

  disableAtHashCheck: false    

};

SOLUTION

I solved this problem setting the LoginTheme: keycloak in realm settings.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Apart from resetting the LoginTheme to the default keycloak theme as you did, if there is already another theme set and you want to keep it, make sure the theme's files are present in keycloak/themes/<the_custom_theme_name_here>/login/, otherwise you'll get the error you mentionned. You may need to restart Keycloak after copying the theme files to their folder if your setup is set to cache the themes.

over 4 years ago · Santiago Trujillo 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