1
0
Fork 0

Taking kerberos realm from intialiser

This commit is contained in:
Paul Rowe-White 2014-01-31 12:31:11 +00:00
parent 98aeddf61b
commit 9a2ed8c467
2 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,12 @@ require 'devise_kerberos_authenticatable/model'
require 'devise_kerberos_authenticatable/strategy' require 'devise_kerberos_authenticatable/strategy'
require 'devise_kerberos_authenticatable/kerberos_adapter' require 'devise_kerberos_authenticatable/kerberos_adapter'
module Devise
#Kerberos realm to use
mattr_accessor :kerberos_realm
@@kerberos_realm = ""
end
Devise.add_module( Devise.add_module(
:kerberos_authenticatable, :kerberos_authenticatable,
:strategy => true, :strategy => true,

View file

@ -9,8 +9,9 @@ module Devise
end end
krb5 = Krb5.new krb5 = Krb5.new
username_with_realm = "#{username}@#{::Devise.kerberos_realm}"
begin begin
krb5.get_init_creds_password(username, password) krb5.get_init_creds_password(username_with_realm, password)
rescue Krb5Auth::Krb5::Exception rescue Krb5Auth::Krb5::Exception
return false return false
end end