Codebase list ruby-omniauth-twitter / b22761c
New upstream snapshot. Debian Janitor 2 years ago
3 changed file(s) with 14 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
11
22 rvm:
33 - 2.1.10
4 - 2.2.6
5 - 2.3.3
6 - 2.4.0
4 - 2.2.9
5 - 2.3.6
6 - 2.4.3
7 - 2.5.0
78 - jruby-1.7.26
89 - rbx-3
910
55
66 This gem contains the Twitter strategy for OmniAuth.
77
8 Twitter offers a few different methods of integration. This strategy implements the browser variant of the "[Sign in with Twitter](https://dev.twitter.com/docs/auth/implementing-sign-twitter)" flow.
8 Twitter offers a few different methods of integration. This strategy implements the browser variant of the "[Sign in with Twitter](https://dev.twitter.com/web/sign-in/implementing)" flow.
99
1010 Twitter uses OAuth 1.0a. Twitter's developer area contains ample documentation on how it implements this, so check that out if you are really interested in the details.
1111
1212 ## Before You Begin
1313
14 You should have already installed OmniAuth into your app; if not, read the [OmniAuth README](https://github.com/intridea/omniauth) to get started.
14 You should have already installed OmniAuth into your app; if not, read the [OmniAuth README](https://github.com/omniauth/omniauth) to get started.
1515
1616 Now sign in into the [Twitter developer area](https://dev.twitter.com/apps) and create an application. Take note of your API Key and API Secret (not the Access Token and Access Token Secret) because that is what your web application will use to authenticate against the Twitter API. Make sure to set a callback URL or else you may get authentication errors. (It doesn't matter what it is, just that it is set.)
1717
4141
4242 ## Authentication Options
4343
44 Twitter supports a [few options](https://dev.twitter.com/docs/api/1/get/oauth/authenticate) when authenticating. Usually you would specify these options as query parameters to the Twitter API authentication url (`https://api.twitter.com/oauth/authenticate` by default). With OmniAuth, of course, you use `http://yourapp.com/auth/twitter` instead. Because of this, this OmniAuth provider will pick up the query parameters you pass to the `/auth/twitter` URL and re-use them when making the call to the Twitter API.
44 Twitter supports a [few options](https://dev.twitter.com/docs/api/1/get/oauth/authenticate) when authenticating. Usually you would specify these options as query parameters to the Twitter API authentication URL (`https://api.twitter.com/oauth/authenticate` by default). With OmniAuth, of course, you use `http://yourapp.com/auth/twitter` instead. Because of this, this OmniAuth provider will pick up the query parameters you pass to the `/auth/twitter` URL and re-use them when making the call to the Twitter API.
4545
4646 The options are:
4747
5151
5252 * **lang** - The language used in the Twitter prompt. This is useful for adding i18n support since the language of the prompt can be dynamically set for each user. *Example:* `http://yoursite.com/auth/twitter?lang=pt`
5353
54 * **secure_image_url** - Set to `true` to use https for the user's image url. Default is `false`.
54 * **secure_image_url** - Set to `true` to use https for the user's image URL. Default is `false`.
5555
5656 * **image_size**: This option defines the size of the user's image. Valid options include `mini` (24x24), `normal` (48x48), `bigger` (73x73) and `original` (the size of the image originally uploaded). Default is `normal`.
5757
58 * **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`
58 * **x_auth_access_type** - This option (described [here](https://developer.twitter.com/en/docs/basics/authentication/api-reference/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`
5959
60 * **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.
60 * **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://developer.twitter.com/en/docs/basics/authentication/api-reference), 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.
6161
62 Here's an example of a possible configuration where the the user's original profile picture is returned over https, the user is always prompted to sign-in and the default language of the Twitter prompt is changed:
62 Here's an example of a possible configuration where the user's original profile picture is returned over https, the user is always prompted to sign-in and the default language of the Twitter prompt is changed:
6363
6464 ```ruby
6565 Rails.application.config.middleware.use OmniAuth::Builder do
0 ruby-omniauth-twitter (1.4.0-2) UNRELEASED; urgency=medium
0 ruby-omniauth-twitter (1.4.0+git20200717.1.41c7be0-1) UNRELEASED; urgency=medium
11
22 [ Utkarsh Gupta ]
33 * Add salsa-ci.yml
1313 * Remove overrides for lintian tags that are no longer supported.
1414 * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
1515 Repository-Browse.
16 * New upstream snapshot.
1617
17 -- Utkarsh Gupta <guptautkarsh2102@gmail.com> Tue, 13 Aug 2019 06:18:04 +0530
18 -- Utkarsh Gupta <guptautkarsh2102@gmail.com> Tue, 08 Jun 2021 03:43:23 -0000
1819
1920 ruby-omniauth-twitter (1.4.0-1) unstable; urgency=medium
2021