首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >密钥披风- MediaType未设置在路径上

密钥披风- MediaType未设置在路径上
EN

Stack Overflow用户
提问于 2021-11-03 09:05:46
回答 1查看 2.9K关注 0票数 4

Keycloak (服务器版本12.0.1)中,当我尝试访问领域登录页面时,会触发以下错误:

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

这是在网页(角)上点击登录按钮生成的URL:

代码语言:javascript
运行
复制
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

角计划

auth.service.ts

代码语言:javascript
运行
复制
public configure() {
authConfig.issuer = this.settingsService.getBaseAuthUrl()}auth/realms/${this._window.location.hostname.split('.')[0]}`;
`this.oauthService.configure(authConfig);

auth.config.ts

代码语言:javascript
运行
复制
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    

};

溶液

我解决了在领域设置中设置LoginTheme: keycloak的问题。

EN

回答 1

Stack Overflow用户

发布于 2022-03-31 14:55:10

除了像以前一样将LoginTheme重置为默认的keycloak主题之外,如果已经有另一个主题集并且希望保留它,请确保主题的文件在keycloak/themes/<the_custom_theme_name_here>/login/中,否则将得到所提到的错误。如果设置设置为缓存主题,则可能需要在将主题文件复制到其文件夹后重新启动Keycloak。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69822167

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档