Sha256: cc3a2228118462f5a3e9cc946cc9c0601ee370c2535b09323e79d0a666d4dcbc
Contents?: true
Size: 1.79 KB
Versions: 3
Compression:
Stored size: 1.79 KB
Contents
require 'openid/extension' require 'openid/util' require 'openid/message' require 'oauth/token' module MySpace module OAuth NS_URI = 'http://specs.openid.net/extensions/oauth/1.0' # begin # Message.register_namespace_alias(NS_URI, 'oauth') # rescue NamespaceAliasRegistrationError => e # Util.log(e) # end # An object to hold the state of a simple registration request. class Request < OpenID::Extension attr_reader :consumer, :scope, :ns_uri def initialize(consumer, scope) super() @ns_uri = NS_URI @ns_alias = 'oauth' @consumer = consumer @scope = scope end def get_extension_args args = {} args['consumer'] = @consumer # args['scope'] = @scope return args end end # Represents the data returned in a simple registration response # inside of an OpenID id_res response. This object will be # created by the OpenID server, added to the id_res response # object, and then extracted from the id_res message by the Consumer. class Response < OpenID::Extension attr_reader :ns_uri, :authorized_request_token def initialize(request_token = nil) @ns_uri = NS_URI @ns_alias = 'oauth' @authorized_request_token = request_token end # Create an Response object from an # OpenID::Consumer::SuccessResponse from consumer.complete # If you set the signed_only parameter to false, unsigned data from # the id_res message from the server will be processed. def self.from_success_response(success_response, oauth_consumer) args = success_response.extension_response(NS_URI, nil) new(::OAuth::RequestToken.new(oauth_consumer, args['request_token'], '')) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
myspaceid-sdk-0.1.11 | lib/myspace/oauth_request.rb |
myspaceid-sdk-0.1.8 | lib/myspace/oauth.rb |
myspaceid-sdk-0.1.9 | lib/myspace/oauth_request.rb |