Class: OpenID::OAuth::Request
- Defined in:
- lib/openid/extensions/oauth.rb
Overview
An OAuth token request, sent from a relying party to a provider
Instance Attribute Summary collapse
-
#consumer ⇒ Object
Returns the value of attribute consumer.
-
#ns_alias ⇒ Object
Returns the value of attribute ns_alias.
-
#ns_uri ⇒ Object
Returns the value of attribute ns_uri.
-
#scope ⇒ Object
Returns the value of attribute scope.
Class Method Summary collapse
-
.from_openid_request(oid_req) ⇒ Object
Instantiate a Request object from the arguments in a checkid_* OpenID message return nil if the extension was not requested.
Instance Method Summary collapse
- #get_extension_args ⇒ Object
-
#initialize(consumer = nil, scope = nil) ⇒ Request
constructor
A new instance of Request.
-
#parse_extension_args(args) ⇒ Object
Set the state of this request to be that expressed in these OAuth arguments.
Methods inherited from Extension
Constructor Details
Instance Attribute Details
#consumer ⇒ Object
Returns the value of attribute consumer.
14 15 16 |
# File 'lib/openid/extensions/oauth.rb', line 14 def consumer @consumer end |
#ns_alias ⇒ Object
Returns the value of attribute ns_alias.
14 15 16 |
# File 'lib/openid/extensions/oauth.rb', line 14 def ns_alias @ns_alias end |
#ns_uri ⇒ Object
Returns the value of attribute ns_uri.
14 15 16 |
# File 'lib/openid/extensions/oauth.rb', line 14 def ns_uri @ns_uri end |
#scope ⇒ Object
Returns the value of attribute scope.
14 15 16 |
# File 'lib/openid/extensions/oauth.rb', line 14 def scope @scope end |
Class Method Details
.from_openid_request(oid_req) ⇒ Object
Instantiate a Request object from the arguments in a checkid_* OpenID message return nil if the extension was not requested.
33 34 35 36 37 38 39 40 41 |
# File 'lib/openid/extensions/oauth.rb', line 33 def self.from_openid_request(oid_req) oauth_req = new args = oid_req..get_args(NS_URI) if args == {} return nil end oauth_req.parse_extension_args(args) return oauth_req end |
Instance Method Details
#get_extension_args ⇒ Object
23 24 25 26 27 28 |
# File 'lib/openid/extensions/oauth.rb', line 23 def get_extension_args ns_args = {} ns_args['consumer'] = @consumer if @consumer ns_args['scope'] = @scope if @scope return ns_args end |
#parse_extension_args(args) ⇒ Object
Set the state of this request to be that expressed in these OAuth arguments
45 46 47 48 |
# File 'lib/openid/extensions/oauth.rb', line 45 def parse_extension_args(args) @consumer = args["consumer"] @scope = args["scope"] end |