首页 > 解决方案 > 取消保护特定当整个站点受到 mod-auth-openidc 保护时

问题描述

我有一个带有 mod-auth-openidc 的 apache 2.4 站点保护。有没有办法取消保护该保护区内的特定物品?现在我的 apache 配置有一小段,其中 mod-auth-openidc 配置为保护整个站点。我发现在 137 个可能的 137 中,有 3 个不需要保护。如果没有办法取消保护 a 那么我将不得不单独保护或取消保护所有 137 。这是很多配置更改。

过去,我可以通过创建标签并指定 Allow from all 和 Satisfy any 来取消对特定位置的保护。这在使用 mod-auth-openidc 时不起作用。我还发现了一篇关于使用 SetEnvIf 提供公共访问权限的帖子,但这也不起作用。

<Location /mynewsite>
   # Protect everything using oidc
   AuthType openid-connect
   Require claim "sub~^employeeGroup2*"
   # Don't protect employeeplans
   SetEnvIf Request_URI "(/mynewsite/employeeplans/)$" allow  
   Order allow,deny
   Allow from env=allow
   Satisfy any         
</Location>

我不会在我的 apache 配置中创建 137 个配置段落。如果没有解决方案,我将不得不放弃这个项目。

标签: mod-auth-openidc

解决方案


AuthType None在这些路径上使用应该可以做到。


推荐阅读