class OpenID::OAuth::Response
A OAuth request token response, sent from a provider to a relying party
Attributes
request_token[RW]
scope[RW]
Public Class Methods
from_success_response(success_response)
click to toggle source
Create a Response object from an OpenID::Consumer::SuccessResponse
# File lib/openid/extensions/oauth.rb, line 64 def self.from_success_response(success_response) args = success_response.get_signed_ns(NS_URI) return nil if args.nil? oauth_resp = new oauth_resp.parse_extension_args(args) return oauth_resp end
new(request_token=nil, scope=nil)
click to toggle source
# File lib/openid/extensions/oauth.rb, line 56 def initialize(request_token=nil, scope=nil) @ns_alias = 'oauth' @ns_uri = NS_URI @request_token = request_token @scope = scope end
Public Instance Methods
get_extension_args()
click to toggle source
# File lib/openid/extensions/oauth.rb, line 81 def get_extension_args ns_args = {} ns_args['request_token'] = @request_token if @request_token ns_args['scope'] = @scope if @scope return ns_args end
parse_extension_args(args, strict=false)
click to toggle source
parse the oauth request arguments into the internal state of this object if strict is specified, raise an exception when bad data is encountered
# File lib/openid/extensions/oauth.rb, line 76 def parse_extension_args(args, strict=false) @request_token = args["request_token"] @scope = args["scope"] end