diff --git a/lib/open_project/authentication.rb b/lib/open_project/authentication.rb index 9b6e4e9ff8..013835b614 100644 --- a/lib/open_project/authentication.rb +++ b/lib/open_project/authentication.rb @@ -83,7 +83,7 @@ module OpenProject module_function def pick_auth_scheme(supported_schemes, default_scheme, request_headers = {}) - req_scheme = request_headers['X-Authentication-Scheme'] + req_scheme = request_headers['HTTP_X_AUTHENTICATION_SCHEME'] if supported_schemes.include? req_scheme req_scheme diff --git a/spec/controllers/api/v2/authentication_spec.rb b/spec/controllers/api/v2/authentication_spec.rb index 25573ac1db..6718e464fe 100644 --- a/spec/controllers/api/v2/authentication_spec.rb +++ b/spec/controllers/api/v2/authentication_spec.rb @@ -120,7 +120,7 @@ describe Api::V2::AuthenticationController, type: :controller do context 'with Session auth scheme requested' do before do - request.env['X-Authentication-Scheme'] = 'Session' + request.env['HTTP_X_AUTHENTICATION_SCHEME'] = 'Session' end it 'has Session auth scheme' do