1 class RequestToken < OauthToken
2 attr_accessor :provided_oauth_verifier
5 return false if authorized?
7 self.authorized_at = Time.now
8 self.verifier = OAuth::Helper.generate_key(20)[0, 20] unless oauth10?
13 return false unless authorized?
14 return false unless oauth10? || verifier == provided_oauth_verifier
16 RequestToken.transaction do
17 params = { :user => user, :client_application => client_application }
18 # copy the permissions from the authorised request token to the access token
19 client_application.permissions.each do |p|
20 params[p] = read_attribute(p)
23 access_token = AccessToken.create(params)
33 "#{super}&oauth_callback_confirmed=true"
38 callback_url.nil? || callback_url.downcase == "oob"
42 (defined? OAUTH_10_SUPPORT) && OAUTH_10_SUPPORT && callback_url.blank?