Module: AuthlogicConnect::Oauth::Session::InstanceMethods

Includes:
Process
Defined in:
lib/authlogic_connect/oauth/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Process

#authenticate_with_oauth, #cleanup_oauth_session, #redirect_to_oauth, #restore_attributes, #save_auth_session_token, #save_oauth_session, #validate_by_oauth

Methods included from Variables

#oauth_consumer, #oauth_provider, #oauth_response, #oauth_token, #oauth_token_and_secret, #oauth_variables, #oauth_version, #token_class

Methods included from AuthlogicConnect::Oauth::State

#allow_oauth_redirect?, #authenticating_with_oauth?, #new_oauth_request?, #oauth_provider?, #oauth_request?, #oauth_response?, #redirecting_to_oauth_server?, #using_oauth?, #validate_password_with_oauth?

Class Method Details

.included(klass) ⇒ Object



14
15
16
17
18
# File 'lib/authlogic_connect/oauth/session.rb', line 14

def self.included(klass)
  klass.class_eval do
    validate :validate_by_oauth, :if => :authenticating_with_oauth?
  end
end

Instance Method Details

#credentials=(value) ⇒ Object

Hooks into credentials so that you can pass a user who has already has an oauth access token.



21
22
23
24
25
26
# File 'lib/authlogic_connect/oauth/session.rb', line 21

def credentials=(value)
  super
  values = value.is_a?(Array) ? value : [value]
  hash = values.first.is_a?(Hash) ? values.first.with_indifferent_access : nil
  self.record = hash[:priority_record] if !hash.nil? && hash.key?(:priority_record)
end

#record=(record) ⇒ Object



28
29
30
# File 'lib/authlogic_connect/oauth/session.rb', line 28

def record=(record)
  @record = record
end