fix error
This commit is contained in:
parent
7ca92d40bd
commit
44df301aca
|
@ -12,9 +12,12 @@ module LdapLogin::Login
|
||||||
uri = URI(LDAP_ADSERVER)
|
uri = URI(LDAP_ADSERVER)
|
||||||
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
|
||||||
req.body = {AppKey: AppKey,username: ldap_user,password: ldap_pass}.to_json
|
req.body = {AppKey: AppKey,username: ldap_user,password: ldap_pass}.to_json
|
||||||
res = Net::HTTP.start(uri.hostname, uri.port) do |http|
|
req.read_timeout = 3000
|
||||||
http.request(req)
|
|
||||||
end
|
http = Net::HTTP.new(uri.host, uri.port)
|
||||||
|
http.use_ssl = true
|
||||||
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
|
res = http.request(req)
|
||||||
|
|
||||||
if res.code == '200' && JSON.load(res.body)["userID"]==ldap_user
|
if res.code == '200' && JSON.load(res.body)["userID"]==ldap_user
|
||||||
if !user.nil?
|
if !user.nil?
|
||||||
|
|
Loading…
Reference in New Issue