1 class Oauth2Verifier < OauthToken
2 validates_presence_of :user
5 def exchange!(params={})
6 OauthToken.transaction do
7 token = Oauth2Token.create! :user=>user,:client_application=>client_application, :scope => scope
23 q << "&state=#{URI.escape(state)}" if @state
30 self.token = OAuth::Helper.generate_key(20)[0,20]
31 self.expires_at = 10.minutes.from_now
32 self.authorized_at = Time.now