1
1
# OmniAuth OAuth
2
2
3
+ ** Note:** This gem is designed to work with the unreleased OmniAuth 1.0
4
+ library. It will not be officially released on RubyGems.org until
5
+ OmniAuth 1.0 is released.
6
+
3
7
This gem contains a generic OAuth strategy for OmniAuth. It is meant to
4
8
serve as a building block strategy for other strategies and not to be
5
9
used independently (since it has no inherent way to gather uid and user
@@ -22,29 +26,24 @@ subclass it and add a few extra methods like so:
22
26
# initializing your consumer from the OAuth gem.
23
27
option :client_options, {:site => "https://api.somesite.com"}
24
28
25
- # This is called after authentication has succeeded. If
29
+ # These are called after authentication has succeeded. If
26
30
# possible, you should try to set the UID without making
27
31
# additional calls (if the user id is returned with the token
28
32
# or as a URI parameter). This may not be possible with all
29
33
# providers.
30
- def uid
31
- request.params['user_id']
32
- end
34
+ uid{ request.params['user_id'] }
33
35
34
- # This is called after authentication has succeeded. You can
35
- # make signed API requests by using the #access_token method
36
- # which is simply an OAuth gem AccessToken object.
37
- def info
36
+ info do
38
37
{
39
38
:name => raw_info['name'],
40
39
:location => raw_info['city']
41
40
}
42
41
end
43
42
44
- def extra
45
- super.merge( {
43
+ extra do
44
+ {
46
45
'raw_info' => raw_info
47
- })
46
+ }
48
47
end
49
48
50
49
def raw_info
@@ -54,4 +53,26 @@ subclass it and add a few extra methods like so:
54
53
end
55
54
end
56
55
57
- That's pretty much it! Once you are successfully
56
+ That's pretty much it!
57
+
58
+ ## License
59
+
60
+ Copyright (C) 2011 by Michael Bleigh and Intridea, Inc.
61
+
62
+ Permission is hereby granted, free of charge, to any person obtaining a copy
63
+ of this software and associated documentation files (the "Software"), to deal
64
+ in the Software without restriction, including without limitation the rights
65
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
+ copies of the Software, and to permit persons to whom the Software is
67
+ furnished to do so, subject to the following conditions:
68
+
69
+ The above copyright notice and this permission notice shall be included in
70
+ all copies or substantial portions of the Software.
71
+
72
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
78
+ THE SOFTWARE.
0 commit comments