add LDAP authentication

This commit is contained in:
Josh
2017-07-05 16:26:27 -04:00
parent 9bbb669cc1
commit ae774b90ce
8 changed files with 58 additions and 1 deletions

View File

@ -47,6 +47,14 @@ class User < ApplicationRecord
auth_hash['info']['email']
end
def self.ldap_username(auth_hash)
auth_hash['info']['nickname']
end
def self.ldap_email(auth_hash)
auth_hash['info']['email']
end
def set_encrypted_id
self.encrypted_id = "#{username[0..1]}-#{Digest::SHA1.hexdigest(uid+provider)[0..7]}"
end