Skip to content
Snippets Groups Projects
Commit f038dd85 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge pull request #1 from patthoyts/pt/failure-reporting

Report missing credentials to the Rails application.
parents 7edf27d0 536c3212
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -38,13 +38,13 @@ module OmniAuth
def callback_phase
@adaptor = OmniAuth::LDAP::Adaptor.new @options
 
# GITLAB security patch
# Dont allow blank password for ldap auth
if request['username'].nil? || request['username'].empty? || request['password'].nil? || request['password'].empty?
raise MissingCredentialsError.new("Missing login credentials")
end
begin
# GITLAB security patch
# Dont allow blank password for ldap auth
if request['username'].nil? || request['username'].empty? || request['password'].nil? || request['password'].empty?
raise MissingCredentialsError.new("Missing login credentials")
end
@ldap_user_info = @adaptor.bind_as(:filter => Net::LDAP::Filter.eq(@adaptor.uid, @options[:name_proc].call(request['username'])),:size => 1, :password => request['password'])
return fail!(:invalid_credentials) if !@ldap_user_info
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment