Re: x509 SSO Authentication
Posted: Tuesday 14 February 2017 1:31
I am having no success in X.509 certificate logon to Domoticz. The cert was issued by XCA, signed by my own CA. I tested many configurations, and could not get the log on to Domiticz. 1) Logon to Nginx with x.509 works.2) Redirect to SSL works. 3) on error go to Google works. 4) Logon to DOmoticz without authentication works. 5) I enable Login-Page, with the correct credentials the log on works. 6) When I change to Basic-Auth, with a certificate, I am getting an off line error message, logon FAILS. 7) I change credentials at Settings to match the CN and password on cert; the logon FAILS. I add users with Admin rights, the same CN and email that I issue my certs; logon FAILS with off-line error.
My configuration is as follows:
- Domoticz beta 3.6707
- Settings: Basic-Auth, with Uner Name and Password entered in the Settings page.
- Domotics and Nginx are on two different RPi's. 192.168.0.3 is Nginx and 192.168.0.4 is Domoticz. Communication between the RPi's are over SSL.
- For ssl_client_certificate /etc/ssl/ca/MyServert.pem; I copied the server certificate.
- Nginx Config:
## Default all HTTP Traffic to HTTPS
server {
listen 80 default;
server_name my.server.org; # Set to your FQDN
rewrite ^ https://$server_name$request_uri? permanent;
}
## Domoticz Secure Proxy
server {
listen 443 default ssl;
server_name my.server.org; # Set to your FQDN
ssl_certificate /etc/ssl/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_dhparam /etc/ssl/certs/dhparam2.pem;
ssl_session_timeout 60m;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:EDH+aRSA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!P$
ssl_prefer_server_ciphers on;
### UNCOMMENT BELOW FOR x509 CLIENT AUTH
ssl_client_certificate /etc/ssl/ca/MyServert_CA.pem;
ssl_verify_client optional;
if ($ssl_client_verify != SUCCESS) {
return 303 http://www.google.com; # Set to your Error Page FQDN.
}
add_header Strict-Transport-Security max-age=63072000;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
## Domoticz
location / {
proxy_pass https://192.168.0.4;
access_log /var/log/nginx/access.domoticz.log;
error_log /var/log/nginx/error.domoticz.log;
### UNCOMMENT BELOW FOR x509 CLIENT SSO
proxy_set_header Authorization $ssl_client_s_dn;
proxy_hide_header Authorization;
}
How do I troubleshoot the SSO authentication?
My configuration is as follows:
- Domoticz beta 3.6707
- Settings: Basic-Auth, with Uner Name and Password entered in the Settings page.
- Domotics and Nginx are on two different RPi's. 192.168.0.3 is Nginx and 192.168.0.4 is Domoticz. Communication between the RPi's are over SSL.
- For ssl_client_certificate /etc/ssl/ca/MyServert.pem; I copied the server certificate.
- Nginx Config:
## Default all HTTP Traffic to HTTPS
server {
listen 80 default;
server_name my.server.org; # Set to your FQDN
rewrite ^ https://$server_name$request_uri? permanent;
}
## Domoticz Secure Proxy
server {
listen 443 default ssl;
server_name my.server.org; # Set to your FQDN
ssl_certificate /etc/ssl/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_dhparam /etc/ssl/certs/dhparam2.pem;
ssl_session_timeout 60m;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:EDH+aRSA:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!P$
ssl_prefer_server_ciphers on;
### UNCOMMENT BELOW FOR x509 CLIENT AUTH
ssl_client_certificate /etc/ssl/ca/MyServert_CA.pem;
ssl_verify_client optional;
if ($ssl_client_verify != SUCCESS) {
return 303 http://www.google.com; # Set to your Error Page FQDN.
}
add_header Strict-Transport-Security max-age=63072000;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
## Domoticz
location / {
proxy_pass https://192.168.0.4;
access_log /var/log/nginx/access.domoticz.log;
error_log /var/log/nginx/error.domoticz.log;
### UNCOMMENT BELOW FOR x509 CLIENT SSO
proxy_set_header Authorization $ssl_client_s_dn;
proxy_hide_header Authorization;
}
How do I troubleshoot the SSO authentication?