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
29 30 31 32 |
# File 'lib/casserver/authenticators/active_resource.rb', line 29 def self.authenticate(credentials = {}) response = send(method_type, method_name, credentials) new.from_authentication_data(response) end |
.method_type ⇒ Object
17 18 19 |
# File 'lib/casserver/authenticators/active_resource.rb', line 17 def self.method_type @@method_type ||= :post end |
.method_type=(type) ⇒ Object
21 22 23 24 25 |
# File 'lib/casserver/authenticators/active_resource.rb', line 21 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
35 36 37 |
# File 'lib/casserver/authenticators/active_resource.rb', line 35 def from_authentication_data response load_attributes_from_response(response) end |