omniauth-twitter 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +13 -7
- data/lib/omniauth-twitter/version.rb +1 -1
- data/lib/omniauth/strategies/twitter.rb +1 -1
- metadata +8 -2
data/README.md
CHANGED
@@ -16,17 +16,23 @@ Now sign in into the [Twitter developer area](http://dev.twitter.com) and create
|
|
16
16
|
|
17
17
|
First start by adding this gem to your Gemfile:
|
18
18
|
|
19
|
-
|
19
|
+
```ruby
|
20
|
+
gem 'omniauth-twitter'
|
21
|
+
```
|
20
22
|
|
21
23
|
If you need to use the latest HEAD version, you can do so with:
|
22
24
|
|
23
|
-
|
25
|
+
```ruby
|
26
|
+
gem 'omniauth-twitter', :github => 'arunagw/omniauth-twitter'
|
27
|
+
```
|
24
28
|
|
25
29
|
Next, tell OmniAuth about this provider. For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
31
|
+
```ruby
|
32
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
33
|
+
provider :twitter, "CONSUMER_KEY", "CONSUMER_SECRET"
|
34
|
+
end
|
35
|
+
```
|
30
36
|
|
31
37
|
Replace CONSUMER_KEY and CONSUMER_SECRET with the appropriate values you obtained from dev.twitter.com earlier.
|
32
38
|
|
@@ -42,13 +48,13 @@ The options are:
|
|
42
48
|
|
43
49
|
* **x_auth_access_type** - This option (described [here](https://dev.twitter.com/docs/api/1/post/oauth/request_token)) lets you request the level of access that your app will have to the Twitter account in question. *Example:* `http://yoursite.com/auth/twitter?x_auth_access_type=read`
|
44
50
|
|
45
|
-
* **use_authorize** - There are actually two URLs you can use against the Twitter API. As mentioned, the default is `https://api.twitter.com/oauth/authenticate`, but you also have `https://api.twitter.com/oauth/authorize`. Passing this option as `true` will use the second URL rather than the first. What's the difference? As described [here](https://dev.twitter.com/docs/api/1/get/oauth/authenticate), with `authenticate`, if your user has already granted permission to your application, Twitter will redirect straight back to your application, whereas `authorize` forces the user to go through the "grant permission" screen again. For certain use cases this may be necessary. *Example:* `http://yoursite.com/auth/twitter?use_authorize=true
|
51
|
+
* **use_authorize** - There are actually two URLs you can use against the Twitter API. As mentioned, the default is `https://api.twitter.com/oauth/authenticate`, but you also have `https://api.twitter.com/oauth/authorize`. Passing this option as `true` will use the second URL rather than the first. What's the difference? As described [here](https://dev.twitter.com/docs/api/1/get/oauth/authenticate), with `authenticate`, if your user has already granted permission to your application, Twitter will redirect straight back to your application, whereas `authorize` forces the user to go through the "grant permission" screen again. For certain use cases this may be necessary. *Example:* `http://yoursite.com/auth/twitter?use_authorize=true`. *Note:* You must have "Allow this application to be used to Sign in with Twitter" checked in [your application's settings](https://dev.twitter.com/apps) - without it your user will be asked to authorize your application each time they log in.
|
46
52
|
|
47
53
|
## Watch the RailsCast
|
48
54
|
|
49
55
|
Ryan Bates has put together an excellent RailsCast on OmniAuth:
|
50
56
|
|
51
|
-
[![RailsCast #241](
|
57
|
+
[![RailsCast #241](http://railscasts.com/static/episodes/stills/241-simple-omniauth-revised.png "RailsCast #241 - Simple OmniAuth (revised)")](http://railscasts.com/episodes/241-simple-omniauth-revised)
|
52
58
|
|
53
59
|
## Supported Rubies
|
54
60
|
|
@@ -47,7 +47,7 @@ module OmniAuth
|
|
47
47
|
end
|
48
48
|
if screen_name && !screen_name.empty?
|
49
49
|
options[:authorize_params] ||= {}
|
50
|
-
options[:authorize_params].merge!(:
|
50
|
+
options[:authorize_params].merge!(:screen_name => screen_name)
|
51
51
|
end
|
52
52
|
if x_auth_access_type
|
53
53
|
options[:request_params] ||= {}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-twitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
@@ -139,12 +139,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
139
|
- - ! '>='
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
|
+
segments:
|
143
|
+
- 0
|
144
|
+
hash: -2812562523271394635
|
142
145
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
146
|
none: false
|
144
147
|
requirements:
|
145
148
|
- - ! '>='
|
146
149
|
- !ruby/object:Gem::Version
|
147
150
|
version: '0'
|
151
|
+
segments:
|
152
|
+
- 0
|
153
|
+
hash: -2812562523271394635
|
148
154
|
requirements: []
|
149
155
|
rubyforge_project: omniauth-twitter
|
150
156
|
rubygems_version: 1.8.25
|