fix error
This commit is contained in:
parent
44df301aca
commit
a2ec4b9334
|
@ -12,11 +12,11 @@ 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
|
||||||
req.read_timeout = 3000
|
|
||||||
|
|
||||||
http = Net::HTTP.new(uri.host, uri.port)
|
http = Net::HTTP.new(uri.host, uri.port)
|
||||||
http.use_ssl = true
|
http.use_ssl = true
|
||||||
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
||||||
|
http.read_timeout = 3
|
||||||
res = http.request(req)
|
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
|
||||||
|
|
Loading…
Reference in New Issue