omniauth-auth0 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +72 -10
- data/lib/auth0/version.rb +1 -1
- data/lib/omniauth/strategies/auth0.rb +12 -0
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c655254b4718ab8def4aaa2dd3420558d1931ca4
|
4
|
+
data.tar.gz: 6da03303cf67444bb641db676ddd64d7919a2335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccc1e93272770cdfaa90b07ecb356ad29b6a2820ba01bdaa461e5d08f5fa9d53419ece7a34a0e842e0aa1996f2676a9993bfba596253047a854ee5f6a18fc6e9
|
7
|
+
data.tar.gz: 99a34d0709e7fde5a9af8757fc0c9db7f95acef140418d2ec458bb7dbefd4f589988538cff94eefcb4a8982eb1a66bdae9913af7b3aab307dc386efde46f354e
|
data/README.md
CHANGED
@@ -16,23 +16,85 @@ Then `bundle install`.
|
|
16
16
|
|
17
17
|
### Rails
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
```ruby
|
20
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
21
|
+
provider :auth0, ENV['CLIENT_ID'], ENV['CLIENT_SECRET'], ENV['YOUR_NAMESPACE']
|
22
|
+
end
|
23
|
+
```ruby
|
22
24
|
|
23
25
|
### Sinatra
|
24
26
|
|
25
|
-
|
26
|
-
|
27
|
-
|
27
|
+
```ruby
|
28
|
+
use OmniAuth::Builder do
|
29
|
+
provider :auth0, ENV['CLIENT_ID'], ENV['CLIENT_SECRET'], ENV['YOUR_NAMESPACE']
|
30
|
+
end
|
31
|
+
```
|
28
32
|
|
29
33
|
> Optional you can set the `:provider_ignores_state` passing a fourth parameter. By default it is true.
|
30
34
|
|
31
|
-
|
35
|
+
### Login widget
|
36
|
+
|
37
|
+
Integrate the widget in one of your pages as described [here](http://docs.auth0.com/widget) or use links as described in the same link.
|
38
|
+
|
39
|
+
### Auth Hash
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
{
|
43
|
+
:provider => 'auth0',
|
44
|
+
:uid => 'google-oauth2|this-is-the-google-id',
|
45
|
+
:info => {
|
46
|
+
:name => 'John Foo',
|
47
|
+
:email => 'johnfoo@example.org',
|
48
|
+
:nickname => 'john',
|
49
|
+
:first_name => 'John',
|
50
|
+
:last_name => 'Foo',
|
51
|
+
:location => 'en',
|
52
|
+
:image => 'https://example.org/john.jpg'
|
53
|
+
},
|
54
|
+
:credentials => {
|
55
|
+
:token => 'XdDadllcas2134rdfdsI',
|
56
|
+
:expires => 'false',
|
57
|
+
:id_token => 'eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJuYW1lIjoiSm9obiBGb28ifQ.lxAiy1rqve8ZHQEQVehUlP1sommPHVJDhgPgFPnDosg',
|
58
|
+
:token_type => 'bearer',
|
59
|
+
},
|
60
|
+
:extra => {
|
61
|
+
:raw_info => {
|
62
|
+
:email => 'johnfoo@example.org',
|
63
|
+
:email_verified => 'true',
|
64
|
+
:name => 'John Foo',
|
65
|
+
:given_name => 'John',
|
66
|
+
:family_name => 'Foo',
|
67
|
+
:picture => 'https://example.org/john.jpg',
|
68
|
+
:gender => 'male',
|
69
|
+
:locale => 'en',
|
70
|
+
:clientID => 'nUBkskdaYdsaxK2n9',
|
71
|
+
:user_id => 'google-oauth2|this-is-the-google-id',
|
72
|
+
:nickname => 'john',
|
73
|
+
:identities => [{
|
74
|
+
:access_token => 'this-is-the-google-access-token',
|
75
|
+
:provider => 'google-oauth2',
|
76
|
+
:expires_in => '3599',
|
77
|
+
:user_id => 'this-is-the-google-id',
|
78
|
+
:connection => 'google-oauth2',
|
79
|
+
:isSocial => 'true',
|
80
|
+
}],
|
81
|
+
:created_at: '2014-07-15T17:19:50.387Z'
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
```
|
86
|
+
|
87
|
+
### ActionDispatch::Cookies::CookieOverflow issue
|
88
|
+
|
89
|
+
If you are getting this error it means that you are using Cookie sessions and since you are storing the whole profile it overflows the max-size of 4K.
|
90
|
+
|
91
|
+
You can change to use In-Memory store for development as follows:
|
32
92
|
|
33
|
-
|
93
|
+
# /config/initializers/session_store.rb
|
94
|
+
CrazyApp::Application.config.session_store :cache_store
|
34
95
|
|
35
|
-
|
96
|
+
# /config/environments/development.rb
|
97
|
+
config.cache_store = :memory_store
|
36
98
|
|
37
99
|
## Documentation
|
38
100
|
|
@@ -40,4 +102,4 @@ For more information about [auth0](http://auth0.com) contact our [documentation
|
|
40
102
|
|
41
103
|
## License
|
42
104
|
|
43
|
-
|
105
|
+
MIT 2013 - AUTH0 INC.
|
data/lib/auth0/version.rb
CHANGED
@@ -32,6 +32,18 @@ module OmniAuth
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
credentials do
|
36
|
+
hash = {'token' => access_token.token}
|
37
|
+
# hash.merge!('refresh_token' => access_token.refresh_token) if access_token.expires? && access_token.refresh_token
|
38
|
+
# hash.merge!('expires_at' => access_token.expires_at) if access_token.expires?
|
39
|
+
hash.merge!('expires' => true)
|
40
|
+
if access_token.params
|
41
|
+
hash.merge!('id_token' => access_token.params['id_token'])
|
42
|
+
hash.merge!('token_type' => access_token.params['token_type'])
|
43
|
+
end
|
44
|
+
hash
|
45
|
+
end
|
46
|
+
|
35
47
|
uid { raw_info["user_id"] }
|
36
48
|
|
37
49
|
extra do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-auth0
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Auth0
|
@@ -10,76 +10,76 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: omniauth-oauth2
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '1.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ~>
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '1.1'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rspec
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ~>
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '2.7'
|
36
36
|
type: :development
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ~>
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '2.7'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: rack-test
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - '>='
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - '>='
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: '0'
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: simplecov
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- -
|
61
|
+
- - '>='
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: '0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- -
|
68
|
+
- - '>='
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: webmock
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - '>='
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - '>='
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
description: Omniauth OAuth2 strategy for the Auth0 platform.
|
@@ -89,7 +89,7 @@ executables: []
|
|
89
89
|
extensions: []
|
90
90
|
extra_rdoc_files: []
|
91
91
|
files:
|
92
|
-
-
|
92
|
+
- .gitignore
|
93
93
|
- Gemfile
|
94
94
|
- README.md
|
95
95
|
- Rakefile
|
@@ -109,17 +109,17 @@ require_paths:
|
|
109
109
|
- lib
|
110
110
|
required_ruby_version: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
|
-
- -
|
112
|
+
- - '>='
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - '>='
|
118
118
|
- !ruby/object:Gem::Version
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project: omniauth-auth0
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.0.3
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Omniauth OAuth2 strategy for the Auth0 platform.
|