mod_auth_openidc:刷新令牌失败

问题描述

我在Apache上使用mod_auth_openidc,并在Grafana前面使用清漆捕获反向代理来卸载SSO OAuth2;登录后,一段时间后,当我调查此问题时,出现以下提取错误;发现OAuth令牌已过期并且mod_auth_openidc无法刷新该令牌;我能够追踪流量

Failed to fetch dashboard
NetworkError when attempting to fetch resource.

mod_auth_openidc令牌刷新流程

  1. 令牌已过期,并且使用HTTP 302将http get调用重定向到oauth服务器
  2. 重定向失败,出现http 403错误,使用HTTP选项方法代替了get或post

Firefox网络流-

enter image description here

如果刷新浏览器并加载整个页面,一切都很好,很奇怪

  1. 使用http 302将mod_auth_openidc重定向到oauth服务器
  2. 刷新令牌,oauth服务器使用http 302重定向到应用程序
  3. 页面加载了http 200

Firefox网络流-

enter image description here

似乎OAuth服务器未在处理HTTP Option方法;我尝试使用“ Require method GET POST”在Apache级别禁用,然后mod_auth_openidc无法正常工作;任何要点或帮助表示赞赏

- 谢谢

解决方法

谢谢, 我能够通过一种解决方法解决该问题。

该问题是由于OHR服务器位于不同的域中,因此XHR请求被阻止(cors)

将OIDCSessionInactivityTimeout更改为24小时可以解决此问题

下面的链接提供了完整的内部信息和配置

https://github.com/zmartzone/mod_auth_openidc/issues/220