Skip to content
Snippets Groups Projects
Commit 22118934 authored by Ping Yu's avatar Ping Yu
Browse files

removed the @URL variable and construct_uri method

parent 232e0886
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3,7 +3,6 @@
require 'rack'
require 'net/ldap'
require 'net/ntlm'
require 'uri'
require 'sasl'
require 'kconv'
module OmniAuth
Loading
Loading
@@ -48,11 +47,9 @@ module OmniAuth
:encryption => method,
:base => @base
}
@uri = construct_uri(@host, @port, @method != :plain)
@bind_method = @try_sasl ? :sasl : (@allow_anonymous||!@bind_dn||!@password ? :anonymous : :simple)
@auth = sasl_auths({:username => @bind_dn, :password => @password}).first if @bind_method == :sasl
@auth ||= { :method => @bind_method,
:username => @bind_dn,
Loading
Loading
@@ -61,11 +58,11 @@ module OmniAuth
config[:auth] = @auth
@connection = Net::LDAP.new(config)
end
#:base => "dc=yourcompany, dc=com",
# :filter => "(mail=#{user})",
# :password => psw
def bind_as(args = {})
def bind_as(args = {})
result = false
@connection.open do |me|
rs = me.search args
Loading
Loading
@@ -140,10 +137,6 @@ module OmniAuth
[Net::NTLM::Message::Type1.new.serialize, nego]
end
 
def construct_uri(host, port, ssl)
protocol = ssl ? "ldaps" : "ldap"
URI.parse("#{protocol}://#{host}:#{port}").to_s
end
end
end
end
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