1 class RequestToken < OauthToken
3 attr_accessor :provided_oauth_verifier
6 return false if authorized?
8 self.authorized_at = Time.now
9 self.verifier = OAuth::Helper.generate_key(16)[0,20] unless oauth10?
14 return false unless authorized?
15 return false unless oauth10? || verifier == provided_oauth_verifier
17 RequestToken.transaction do
18 params = { :user => user, :client_application => client_application }
19 # copy the permissions from the authorised request token to the access token
20 client_application.permissions.each { |p|
21 params[p] = read_attribute(p)
24 access_token = AccessToken.create(params)
34 "#{super}&oauth_callback_confirmed=true"
39 self.callback_url=='oob'
43 (defined? OAUTH_10_SUPPORT) && OAUTH_10_SUPPORT && self.callback_url.blank?