Taking kerberos realm from intialiser
This commit is contained in:
parent
98aeddf61b
commit
9a2ed8c467
2 changed files with 8 additions and 1 deletions
|
@ -6,6 +6,12 @@ require 'devise_kerberos_authenticatable/model'
|
|||
require 'devise_kerberos_authenticatable/strategy'
|
||||
require 'devise_kerberos_authenticatable/kerberos_adapter'
|
||||
|
||||
module Devise
|
||||
#Kerberos realm to use
|
||||
mattr_accessor :kerberos_realm
|
||||
@@kerberos_realm = ""
|
||||
end
|
||||
|
||||
Devise.add_module(
|
||||
:kerberos_authenticatable,
|
||||
:strategy => true,
|
||||
|
|
|
@ -9,8 +9,9 @@ module Devise
|
|||
end
|
||||
|
||||
krb5 = Krb5.new
|
||||
username_with_realm = "#{username}@#{::Devise.kerberos_realm}"
|
||||
begin
|
||||
krb5.get_init_creds_password(username, password)
|
||||
krb5.get_init_creds_password(username_with_realm, password)
|
||||
rescue Krb5Auth::Krb5::Exception
|
||||
return false
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue