diff --git a/lib/devise-kerberos-authenticatable.rb b/lib/devise-kerberos-authenticatable.rb index 4456d2e..b11abee 100644 --- a/lib/devise-kerberos-authenticatable.rb +++ b/lib/devise-kerberos-authenticatable.rb @@ -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, diff --git a/lib/devise_kerberos_authenticatable/kerberos_adapter.rb b/lib/devise_kerberos_authenticatable/kerberos_adapter.rb index 6b6c536..4f5ca1a 100644 --- a/lib/devise_kerberos_authenticatable/kerberos_adapter.rb +++ b/lib/devise_kerberos_authenticatable/kerberos_adapter.rb @@ -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