Module: Passport::Oauth::Authorizable::InstanceMethods

Defined in:
lib/passport/oauth/client/authorizable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#authorize_urlObject

key is a way to 100% uniquely identify a user, even if token or secret change “token” passed from provider oauth “secret” passed from provider



59
60
61
# File 'lib/passport/oauth/client/authorizable.rb', line 59

def authorize_url
  @authorize_url
end

Instance Method Details

#access(options) ⇒ Object



69
70
71
72
73
74
75
76
# File 'lib/passport/oauth/client/authorizable.rb', line 69

def access(options)
  options = {:token => self.token, :secret => self.secret}.merge(options)
  hash = self.class.access(options)
  self.key           = hash[:key]
  self.token         = hash[:token]
  self.secret        = hash[:secret]
  hash
end

#authorize(callback_url, options = {}) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/passport/oauth/client/authorizable.rb', line 61

def authorize(callback_url, options = {})
  hash = self.class.authorize(callback_url, options)
  self.authorize_url = hash[:url]
  self.token         = hash[:token]
  self.secret        = hash[:secret]
  hash
end

#credentialsObject



78
79
80
# File 'lib/passport/oauth/client/authorizable.rb', line 78

def credentials
  self.class.credentials
end