omniauth-bike-index 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -7
- data/lib/omniauth/bike_index/version.rb +1 -1
- data/lib/omniauth/strategies/bike_index.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4904847b367892ffa7711c26f0ec6d6df8fd25d3
|
4
|
+
data.tar.gz: 96c8d478c2e4845b5223a0756f27ff6cd051edcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d6395ff98fdb48179672b1f425619952859bc96b2fff388cf22e668431aafe9e8a63a5de320061cc7676505d0afd4f4878bc470fc7d699e8c6ec4c5b4ddab54
|
7
|
+
data.tar.gz: ad745ff6b887f1d01fbdffc4f3822c5fcc18c74b44b4c3a3c6c36d10dfaae9aeb507bbe679b2dfabbd6e257c0aba2c0bfdce981f6ff7f2573520494aed973be8
|
data/README.md
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
# OmniAuth::BikeIndex [![Build Status](https://travis-ci.org/bikeindex/omniauth-bike-index.svg?branch=master)](https://travis-ci.org/bikeindex/omniauth-bike-index)
|
2
|
-
==============
|
3
2
|
|
4
3
|
Bike Index OAuth2 Strategy for OmniAuth 1.0.
|
5
4
|
|
6
5
|
Supports the OAuth 2.0 server-side and client-side flows.
|
7
6
|
|
8
|
-
|
9
7
|
## Creating an application
|
10
8
|
|
11
9
|
To be able to use OAuth on the Bike Index, you have to create an application. Go to [BikeIndex.org/oauth/applications](https://bikeindex.org/oauth/applications) to add your application.
|
@@ -14,7 +12,6 @@ Once you've added your application and your routes, you'll be able to see your A
|
|
14
12
|
|
15
13
|
**Note**: Callback url has to be an exact match - if your url is `http://localhost:3001/users/auth/bike_index/callback` you _must_ enter that exactly - `http://localhost:3001/users/auth/` will not work.
|
16
14
|
|
17
|
-
|
18
15
|
Check out the **[Bike Index API Documentation](https://bikeindex.org/documentation)** to see what can be done with authenticated users.
|
19
16
|
|
20
17
|
## Usage
|
@@ -62,7 +59,6 @@ end
|
|
62
59
|
|
63
60
|
Available scopes: `read_user`, `write_user`, `read_bikes`, `write_bikes`
|
64
61
|
|
65
|
-
|
66
62
|
## Credentials
|
67
63
|
|
68
64
|
If you don't include a scope, the response will include a `uid` from Bike Index for the user and nothing else.
|
@@ -71,11 +67,9 @@ If you include the `read_bikes` scope, the response will include an array of the
|
|
71
67
|
|
72
68
|
You can use these IDs to access information about the bikes - e.g. [api/v3/bikes/3414](https://bikeindex.org/api/v3/bikes/3414) & [api/v3/bikes/29367](https://bikeindex.org/api/v3/bikes/29367)
|
73
69
|
|
74
|
-
If you include the `read_user` scope, the response will include the user's nickname, email and name. You will also see their twitter handle and avatar if they have added them. The keys for these items -
|
70
|
+
If you include the `read_user` scope, the response will include the user's nickname, email and name. You will also see their twitter handle and avatar if they have added them. The keys for these items -
|
75
71
|
`nickname`, `email`, `name`, `twitter` & `image` - all accessible in the `request.env['omniauth.auth']`, e.g. `request.env['omniauth.auth'].info.email`
|
76
72
|
|
77
|
-
|
78
73
|
## Auth Hash
|
79
74
|
|
80
75
|
You can also see the authetication hash (in JSON format) by going to the authentication url on the Bike Index with the user's access token - `https://bikeindex.org/api/v3/me?access_token=<OAUTH_ACCESS_TOKEN>`
|
81
|
-
|
@@ -35,7 +35,12 @@ module OmniAuth
|
|
35
35
|
super
|
36
36
|
end
|
37
37
|
|
38
|
-
|
38
|
+
# https://github.com/omniauth/omniauth-oauth2/issues/81
|
39
|
+
def callback_url
|
40
|
+
full_host + script_name + callback_path
|
41
|
+
end
|
42
|
+
|
43
|
+
private
|
39
44
|
|
40
45
|
def prune!(hash)
|
41
46
|
hash.delete_if do |_, value|
|
@@ -43,7 +48,6 @@ module OmniAuth
|
|
43
48
|
value.nil? || (value.respond_to?(:empty?) && value.empty?)
|
44
49
|
end
|
45
50
|
end
|
46
|
-
|
47
51
|
end
|
48
52
|
end
|
49
53
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-bike-index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Herr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|