Class: OmniAuth::Strategies::Krb5
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::Krb5
- Includes:
- OmniAuth::Strategy
- Defined in:
- lib/omniauth/strategies/krb5.rb
Instance Method Summary collapse
- #callback_phase ⇒ Object
-
#initialize(app, *args, &block) ⇒ Krb5
constructor
A new instance of Krb5.
- #realm ⇒ Object
- #request_phase ⇒ Object
Constructor Details
#initialize(app, *args, &block) ⇒ Krb5
Returns a new instance of Krb5.
12 13 14 15 16 |
# File 'lib/omniauth/strategies/krb5.rb', line 12 def initialize( app, *args, &block ) super @krb5 = Kerberos::Krb5.new @krb5.set_default_realm(.realm) end |
Instance Method Details
#callback_phase ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/omniauth/strategies/krb5.rb', line 25 def callback_phase begin return fail!(:invalid_credentials) unless username && password @krb5.get_init_creds_password(username_with_realm, password) super rescue Exception => e return fail!(:invalid_credentials, e) ensure @krb5.close end end |
#realm ⇒ Object
45 46 47 |
# File 'lib/omniauth/strategies/krb5.rb', line 45 def realm @krb5.get_default_realm end |
#request_phase ⇒ Object
18 19 20 21 22 23 |
# File 'lib/omniauth/strategies/krb5.rb', line 18 def request_phase OmniAuth::Form.build(:title => .title, :url => callback_path) do text_field 'Username', 'username' password_field 'Password', 'password' end.to_response end |