diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4e0bce0..d982c1b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -25,7 +25,7 @@ class ApplicationController < ActionController::Base # Only run if the user is not yet logged in if not user_signed_in? if debian_sso_dn = request.env['HTTP_X_DEBIAN_SSO_DN'] - debian_sso_dn =~ /\/CN=(.+)/ + debian_sso_dn =~ /^CN=(.+),/ debian_email = $1 @user = User.where(provider: 'debian-sso', email: debian_email).first_or_create do |user| diff --git a/nginx/sophisticated-nginx.conf b/nginx/sophisticated-nginx.conf index c8f113a..949e284 100644 --- a/nginx/sophisticated-nginx.conf +++ b/nginx/sophisticated-nginx.conf @@ -90,6 +90,7 @@ http { } location @backend { + proxy_set_header x_debian_sso_dn $ssl_client_s_dn; proxy_pass http://127.0.0.1:3000; } @@ -113,10 +114,6 @@ http { expires 1h; add_header X-Coffee images; } - - location /debian_sso/ { - # - } } }