Class: OpenID::OAuth::Response
- Defined in:
- lib/openid/extensions/oauth.rb
Overview
A OAuth request token response, sent from a provider to a relying party
Instance Attribute Summary collapse
-
#ns_uri ⇒ Object
Returns the value of attribute ns_uri.
-
#request_token ⇒ Object
Returns the value of attribute request_token.
-
#scope ⇒ Object
Returns the value of attribute scope.
Class Method Summary collapse
-
.from_success_response(success_response) ⇒ Object
Create a Response object from an OpenID::Consumer::SuccessResponse.
Instance Method Summary collapse
- #get_extension_args ⇒ Object
-
#initialize(request_token = nil, scope = nil) ⇒ Response
constructor
A new instance of Response.
-
#parse_extension_args(args, strict = false) ⇒ Object
parse the oauth request arguments into the internal state of this object if strict is specified, raise an exception when bad data is encountered.
Methods inherited from Extension
Constructor Details
Instance Attribute Details
#ns_uri ⇒ Object
Returns the value of attribute ns_uri.
55 56 57 |
# File 'lib/openid/extensions/oauth.rb', line 55 def ns_uri @ns_uri end |
#request_token ⇒ Object
Returns the value of attribute request_token.
55 56 57 |
# File 'lib/openid/extensions/oauth.rb', line 55 def request_token @request_token end |
#scope ⇒ Object
Returns the value of attribute scope.
55 56 57 |
# File 'lib/openid/extensions/oauth.rb', line 55 def scope @scope end |
Class Method Details
.from_success_response(success_response) ⇒ Object
Create a Response object from an OpenID::Consumer::SuccessResponse
64 65 66 67 68 69 70 |
# 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 |
Instance Method Details
#get_extension_args ⇒ Object
81 82 83 84 85 86 |
# 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) ⇒ Object
parse the oauth request arguments into the internal state of this object if strict is specified, raise an exception when bad data is encountered
76 77 78 79 |
# File 'lib/openid/extensions/oauth.rb', line 76 def parse_extension_args(args, strict=false) @request_token = args["request_token"] @scope = args["scope"] end |