omniauth-openid-connect 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b7008499c533fd017b461f9d06c1c4edf013bdb
|
4
|
+
data.tar.gz: 931b2338aa8c6b3db58f064f7a3be258b796b8c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97d00ff91a14014f3eaaa7718b6ee17dc9f9cd6c6cd7ce7f4d89740150e5ca9fd94eff3345b8b862177e7c32ca85e13b314e54435e76c92fd76c7c60ad3d688c
|
7
|
+
data.tar.gz: 4bc327762fe0e2ad553fa195e5861ce3f71ee840a7684c8c5356c08782a69665d02f984e5fca2f4e5654c489a7552bebc232cd484ecdaf3d13019006f62170bc
|
data/README.md
CHANGED
@@ -22,9 +22,34 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
Example configuration
|
26
|
+
```ruby
|
27
|
+
config.omniauth :openid_connect, {
|
28
|
+
name: :my_provider,
|
29
|
+
scope: [:openid, :email, :profile, :address],
|
30
|
+
response_type: :code,
|
31
|
+
client_options: {
|
32
|
+
port: 443,
|
33
|
+
scheme: "https",
|
34
|
+
host: "myprovider.com",
|
35
|
+
identifier: ENV["OP_CLIENT_ID"],
|
36
|
+
secret: ENV["OP_SECRET_KEY"],
|
37
|
+
redirect_uri: "http://myapp.com/users/auth/openid_connect/callback",
|
38
|
+
},
|
39
|
+
}
|
40
|
+
```
|
41
|
+
|
42
|
+
Configuration details:
|
43
|
+
* `name` is arbitrary, I recommend using the name of your provider. The name
|
44
|
+
configuration exists because you could be using multiple OpenID Connect
|
45
|
+
providers in a single app.
|
46
|
+
* Although `response_type` is an available option, currently, only `:code`
|
47
|
+
is valid. There are plans to bring in implicit flow and hybrid flow at some
|
48
|
+
point, but it hasn't come up yet for me. Those flows aren't best practive for
|
49
|
+
server side web apps anyway and are designed more for native/mobile apps.
|
50
|
+
|
51
|
+
For the full low down on OpenID Connect, please check out
|
52
|
+
[the spec](http://openid.net/specs/openid-connect-core-1_0.html).
|
28
53
|
|
29
54
|
## Contributing
|
30
55
|
|
@@ -8,8 +8,6 @@ module OmniAuth
|
|
8
8
|
class OpenIDConnect
|
9
9
|
include OmniAuth::Strategy
|
10
10
|
|
11
|
-
attr_accessor :access_token
|
12
|
-
|
13
11
|
option :client_options, {
|
14
12
|
identifier: nil,
|
15
13
|
secret: nil,
|
@@ -39,7 +37,7 @@ module OmniAuth
|
|
39
37
|
{
|
40
38
|
name: user_info.name,
|
41
39
|
email: user_info.email,
|
42
|
-
nickname: user_info.
|
40
|
+
nickname: user_info.preferred_username,
|
43
41
|
first_name: user_info.given_name,
|
44
42
|
last_name: user_info.family_name,
|
45
43
|
image: user_info.picture,
|
@@ -38,7 +38,7 @@ class OmniAuth::Strategies::OpenIDConnectTest < StrategyTestCase
|
|
38
38
|
info = strategy.info
|
39
39
|
assert_equal user_info.name, info[:name]
|
40
40
|
assert_equal user_info.email, info[:email]
|
41
|
-
assert_equal user_info.
|
41
|
+
assert_equal user_info.preferred_username, info[:nickname]
|
42
42
|
assert_equal user_info.given_name, info[:first_name]
|
43
43
|
assert_equal user_info.family_name, info[:last_name]
|
44
44
|
assert_equal user_info.picture, info[:image]
|
data/test/test_helper.rb
CHANGED
@@ -33,7 +33,8 @@ class StrategyTestCase < MiniTest::Test
|
|
33
33
|
sub: SecureRandom.hex(16),
|
34
34
|
name: Faker::Name.name,
|
35
35
|
email: Faker::Internet.email,
|
36
|
-
nickname: Faker::
|
36
|
+
nickname: Faker::Name.first_name,
|
37
|
+
preferred_username: Faker::Internet.user_name,
|
37
38
|
given_name: Faker::Name.first_name,
|
38
39
|
family_name: Faker::Name.last_name,
|
39
40
|
picture: Faker::Internet.url + ".png",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-openid-connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bohn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|