我们需要哪些选项来配置 WSO2 IS x509Authenticator 以在仅允许 80 和 443 端口的防火墙后面工作?
如果我们这样设置x509 servlet
[custom_transport.x509.properties]
port="8443"
...
[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain:8443/x509-certificate-servlet"
那么我们将无法访问防火墙后面的这个端点。
所以我们为 nginx 配置设置这个位置。
location /x509-certificate-servlet {
proxy_pass https://<is_server>:8443;
和x509
[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain/x509-certificate-servlet"
x509 成功验证用户身份并重定向到
https://mydomain:8443/commonauth
。由于防火墙屏蔽了 8443 端口,显然无法访问。
我见过类似的主题WSO2 Identity Server X509 Authentication Behind Proxy但它没有详细说明防火墙问题。
github问题上的评论https://github.com/wso2/product-is/issues/17484试图解释x509验证器工作流程。根据我在那里读到的内容,我得出结论,x509 servlet 重定向到它自己的 commonauth 端点,而不是服务器的端点。
因此我们有两个有效的相似端点
https://mydomain/commonauth
和https://mydomain:8443/commonauth
。对于这一点,我认为无法通过同一服务器端口上的 nginx 位置进行分隔。因为第二个是不可配置的。
一种解决方案是为 x509 servlet 注册单独的域
[authentication.authenticator.x509_certificate.parameters]
AuthenticationEndpoint="https://mydomain-x509/x509-certificate-servlet"
server {
listen 443 ssl;
server_name mydomain-x509;
ssl_verify_client optional_no_ca;
...
location / {
proxy_pass https://127.0.0.1:8443;
proxy_set_header X-SSL-CERT $ssl_client_escaped_cert;
...
但是 x509 servlet 再次重定向到
https://mydomain:8443/commonauth
所以这个方法也行不通。
有可行的解决方案吗?我错过了什么?
我最近发表了一篇文章 [1],详细介绍了如何在多节点集群配置中设置 X509 身份验证器,由 NGINX 负责。在我的设置中,我将身份验证器托管在与 WSO2 身份服务器相同的端口上,即端口 9443。您可能会发现此方法有助于解决防火墙问题。您可以尝试一下并告诉我它是否适合您的情况吗?