我使用traefik作为反向代理 . 我想为entryPoint设置OAuth2身份验证 . 在文件中我找到了Forward Authentication,我认为这可能对此有用 . 但该文件太简单了
此配置将首先将请求转发到http://authserver.com/auth . 如果响应代码为2XX,则授予访问权限并执行原始请求 . 否则,返回来自认证服务器的响应 .
我've no idea how can I archive authentication OAuth2 within an forwarding? I'已经尝试oauth2_proxy但没有找到解决方案 .
在这个issue/comment guybrush提供了一个解决方案 . 但事实上,这是一个双反转代理 .
1 回答
我最近为此构建了一个应用程序:https://github.com/thomseddon/traefik-forward-auth
如您所述,它使用转发身份验证,并使用Google OAuth对用户进行身份验证 .
这里有一个docker compose设置示例:https://github.com/thomseddon/traefik-forward-auth/blob/master/example/docker-compose.yml
如果它有用,请告诉我!