Class: OauthChina::Qq
- Inherits:
-
OAuth
- Object
- OAuth
- OauthChina::Qq
show all
- Defined in:
- lib/oauth_china/strategies/qq.rb
Constant Summary
Constants inherited
from OAuth
OAuth::CONFIG
Instance Attribute Summary
Attributes inherited from OAuth
#access_token, #consumer_options, #request_token
Instance Method Summary
collapse
Methods inherited from OAuth
#authorize, #authorize_url, #callback, #config, #consumer, #dump, #key, load, #oauth_token, #secret, #url
Constructor Details
#initialize(*args) ⇒ Qq
Returns a new instance of Qq.
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/oauth_china/strategies/qq.rb', line 4
def initialize(*args)
self.consumer_options = {
:site => "https://open.t.qq.com",
:request_token_path => "/cgi-bin/request_token",
:access_token_path => "/cgi-bin/access_token",
:authorize_path => "/cgi-bin/authorize",
:http_method => :get,
:scheme => :query_string,
:nonce => nonce,
:realm => url
}
super(*args)
end
|
Instance Method Details
#authorized? ⇒ Boolean
26
27
28
|
# File 'lib/oauth_china/strategies/qq.rb', line 26
def authorized?
end
|
#destroy ⇒ Object
30
31
32
|
# File 'lib/oauth_china/strategies/qq.rb', line 30
def destroy
end
|
#name ⇒ Object
18
19
20
|
# File 'lib/oauth_china/strategies/qq.rb', line 18
def name
:qq
end
|
#nonce ⇒ Object
22
23
24
|
# File 'lib/oauth_china/strategies/qq.rb', line 22
def nonce
Base64.encode64(OpenSSL::Random.random_bytes(32)).gsub(/\W/, '')[0, 32]
end
|