Class: CASServer::Authenticators::Helpers::Identity
- Inherits:
-
ActiveResource::Base
- Object
- ActiveResource::Base
- CASServer::Authenticators::Helpers::Identity
- Defined in:
- lib/casserver/authenticators/active_resource.rb
Class Method Summary collapse
-
.authenticate(credentials = {}) ⇒ Object
Autenticate an identity using the given method.
- .method_type ⇒ Object
- .method_type=(type) ⇒ Object
Instance Method Summary collapse
-
#from_authentication_data(response) ⇒ Object
Used to load object attributes from the given response.
Class Method Details
.authenticate(credentials = {}) ⇒ Object
Autenticate an identity using the given method
43 44 45 46 |
# File 'lib/casserver/authenticators/active_resource.rb', line 43 def self.authenticate(credentials = {}) response = send(method_type, method_name, credentials) new.from_authentication_data(response) end |
.method_type ⇒ Object
31 32 33 |
# File 'lib/casserver/authenticators/active_resource.rb', line 31 def self.method_type @@method_type ||= :post end |
.method_type=(type) ⇒ Object
35 36 37 38 39 |
# File 'lib/casserver/authenticators/active_resource.rb', line 35 def self.method_type= type methods = [:get, :post, :put, :delete] raise ArgumentError, "Method type should be one of #{methods.map { |m| m.to_s.upcase }.join(', ')}" unless methods.include? type.to_sym @@method_type = type end |
Instance Method Details
#from_authentication_data(response) ⇒ Object
Used to load object attributes from the given response
49 50 51 |
# File 'lib/casserver/authenticators/active_resource.rb', line 49 def from_authentication_data response load_attributes_from_response(response) end |