Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDAP adaptor initialization exceptions cannot be handled #77

Open
btapia opened this issue Nov 3, 2017 · 0 comments
Open

LDAP adaptor initialization exceptions cannot be handled #77

btapia opened this issue Nov 3, 2017 · 0 comments

Comments

@btapia
Copy link

btapia commented Nov 3, 2017

Currently, in the callback_phase, none of the exceptions raised by the initialization of OmniAuth::LDAP::Adaptor are captured and derived to the fail!() method, giving no opportunity to be handled by the application.

The initialization is being done outside the begin-rescue block.

def callback_phase
  @adaptor = OmniAuth::LDAP::Adaptor.new @options

  return fail!(:missing_credentials) if missing_credentials?
  begin
    @ldap_user_info = @adaptor.bind_as(:filter => filter(@adaptor), :size => 1, :password => request['password'])
    return fail!(:invalid_credentials) if !@ldap_user_info

    @user_info = self.class.map_user(@@config, @ldap_user_info)
    super
  rescue Exception => e
    return fail!(:ldap_error, e)
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant