title: Keycloak - MediaType not set on path
body: <p>In <strong>Keycloak</strong> (Server Version <strong>12.0.1</strong>), when I try to reach a realm login page, these errors are triggered:</p>
  <p><code>09:44:04,737 ERROR [org.keycloak.headers.DefaultSecurityHeadersProvider] (default task-1)  MediaType not set on path /auth/realms/&lt;realm-name&gt;/protocol/openid-connect/auth, with response status 500</code></p>
  <p><code>09:44:04,738 ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /auth/realms/&lt;realm-name&gt;/protocol/openid-connect/auth: java.lang.RuntimeException: java.lang.RuntimeException: org.jboss.resteasy.spi.UnhandledException: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error</code></p>
  <p>This is the URL generated clicking on Login button on web page (Angular ):</p>
  <pre><code>https://auth.&lt;project-name&gt;.local:5001/auth/realms/&lt;realm-name&gt;/protocol/openid-connect/auth?response_type=code&amp;client_id=&lt;client-id&gt;&amp;state=MWl1SkQwNE1vaXZ1LXdLVGh6MWhvZGJiVldPVy40RTJwU2pVfmZ5ZzhsTmRZ&amp;redirect_uri=http%3A%2F%2F&lt;realm-name&gt;%3A4288%2F&amp;scope=openid%20profile%20email%20offline_access%20&lt;clientId&gt;&amp;code_challenge=OPHLi0y4cM0BtILP12xVwUH8p_SiJZjZx1c_ehsFwB4&amp;code_challenge_method=S256&amp;nonce=MWl1SkQwNE1vaXZ1LXdLVGh6MWhvZGJiVldPVy40RTJwU2pVfmZ5ZzhsTmRZ
  </code></pre>
  <p><strong>Angular project</strong></p>
  <p><em><strong>auth.service.ts</strong></em></p>
  <pre><code>public configure() {
  authConfig.issuer = this.settingsService.getBaseAuthUrl()}auth/realms/${this._window.location.hostname.split('.')[0]}`;
  `this.oauthService.configure(authConfig);
  </code></pre>
  <p><em><strong>auth.config.ts</strong></em></p>
  <pre><code>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: '&lt;clientId&gt;',
    
    scope: 'openid profile email offline_access &lt;clientId&gt;',
  
    requireHttps: true,
  
    showDebugInformation: true,
  
    responseType: 'code',
  
    disableAtHashCheck: false    
  
  };
  </code></pre>
  <h2><strong>SOLUTION</strong></h2>
  <p>I solved this problem setting the <code>LoginTheme: keycloak</code> in realm settings.</p>