livedoorauth 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +3 -0
- data/README.txt +32 -3
- data/lib/livedoor/api/auth.rb +1 -1
- data/lib/livedoor/api/version.rb +1 -1
- data/test/test_auth.rb +3 -1
- metadata +2 -2
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -1,3 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
= Livedoor::API::Auth -- Livedoor Authentication API
|
2
|
+
|
3
|
+
== SYNOPSIS
|
4
|
+
|
5
|
+
require 'rubygems'
|
6
|
+
require 'livedoorauth'
|
7
|
+
auth = Livedoor::API::Auth.new(:app_key => YOUR_API_KEY, :secret => YOUR_SECRET_KEY)
|
8
|
+
|
9
|
+
# login_uri generate
|
10
|
+
auth.uri_to_login
|
11
|
+
|
12
|
+
# login check
|
13
|
+
user = auth.validate_response(uri.query)
|
14
|
+
|
15
|
+
# get livedoor id
|
16
|
+
id = auth.get_livedoor_id(user)
|
17
|
+
|
18
|
+
|
19
|
+
== NOTES
|
20
|
+
see test/test_auth.rb
|
21
|
+
|
22
|
+
== Installation
|
23
|
+
|
24
|
+
# gem install livedoorauth
|
25
|
+
|
26
|
+
== License
|
27
|
+
|
28
|
+
MIT
|
29
|
+
|
30
|
+
== Author
|
31
|
+
|
32
|
+
zoriorz@gmail.com
|
data/lib/livedoor/api/auth.rb
CHANGED
data/lib/livedoor/api/version.rb
CHANGED
data/test/test_auth.rb
CHANGED
@@ -28,11 +28,13 @@ class TestLivedoorAuth < Test::Unit::TestCase
|
|
28
28
|
#get auth info
|
29
29
|
agent.redirect_ok = false
|
30
30
|
auth = Livedoor::API::Auth.new(:app_key => APPKEY, :secret => SECRET)
|
31
|
-
|
31
|
+
userdata = 'userdata'
|
32
|
+
uri = auth.uri_to_login(:perms=>'id', :userdata=>userdata)
|
32
33
|
page = agent.get(uri.to_s)
|
33
34
|
uri = URI.parse(page.response['location'])
|
34
35
|
user = auth.validate_response(uri.query)
|
35
36
|
assert_not_nil(user[:userhash])
|
37
|
+
assert_equal(userdata, user[:userdata])
|
36
38
|
|
37
39
|
#get livedoor id
|
38
40
|
id = auth.get_livedoor_id(user)
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: livedoorauth
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.
|
7
|
-
date: 2007-04-
|
6
|
+
version: 0.0.2
|
7
|
+
date: 2007-04-23 00:00:00 +09:00
|
8
8
|
summary: livedoor auth api
|
9
9
|
require_paths:
|
10
10
|
- lib
|