Browse Source

Improved error message for SSO if REMOTE_USER is blank.

Martin Edenhofer 4 years ago
parent
commit
8a3be0488d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/controllers/application_controller/authenticates.rb

+ 2 - 2
app/controllers/application_controller/authenticates.rb

@@ -146,11 +146,11 @@ module ApplicationController::Authenticates
               login = request.env['REMOTE_USER'] ||
                       request.env['HTTP_REMOTE_USER'] ||
                       request.headers['X-Forwarded-User']
-
               User.lookup(login: login&.downcase)
             end
 
-    raise Exceptions::NotAuthorized, 'Missing SSO ENV REMOTE_USER' if !user
+    raise Exceptions::NotAuthorized, 'Missing SSO ENV REMOTE_USER' if login.blank?
+    raise Exceptions::NotAuthorized, "No such user #{login} from ENV REMOTE_USER" if !user
 
     session.delete(:switched_from_user_id)
     authentication_check_prerequesits(user, 'SSO', {})