omniauth-vatsim 0.1.5 → 0.1.6
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 +26 -9
- data/lib/omniauth-vatsim/version.rb +1 -1
- data/lib/omniauth/strategies/vatsim.rb +1 -0
- 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: c26ba6c5cced00dd267e6316e190f959834db29c
|
4
|
+
data.tar.gz: 4e7e6a96c6a05c6db96988356ccb848ff3d2883c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f7003a65a55d0619464b21bdf703f1263973677632762ea73c412d72793897547ea1149a6fbc53dc4c4c23e59467fac3920946d5ff1b5dde64ece6a0e45d758
|
7
|
+
data.tar.gz: ed470ebe23b228788612b8be69d960a8bb28b0fd3ddfa5ff7a34f4d2cfc3a4f6571dc39f6854cb224e95e2fbe01cf0b498149d3a243899396f6b090d1c721828
|
data/README.md
CHANGED
@@ -34,26 +34,40 @@ gem 'omniauth-vatsim', git: 'https://github.com/jvoss/omniauth-vatsim.git'
|
|
34
34
|
```
|
35
35
|
|
36
36
|
### RSA-SHA1 (Recommended)
|
37
|
+
#### IMPORTANT NOTE
|
38
|
+
An issue with OAuth-Ruby v0.5.1 requires the consumer secret to
|
39
|
+
be set with RSA-SHA1. Unfortunately that means it must be set to the
|
40
|
+
contents of an unencrypted (no passphrase) private key file! In my examples
|
41
|
+
below, I suggest a way to do this in memory while still keeping a passphrase
|
42
|
+
on the key.
|
43
|
+
|
44
|
+
Specifically the issue lies [here](https://github.com/oauth-xx/oauth-ruby/blob/v0.5.1/lib/oauth/signature/rsa/sha1.rb)
|
45
|
+
at line 37. It does not matter if a private key is specified in the consumer, it
|
46
|
+
always will instantiate a new private key object.
|
37
47
|
|
38
48
|
For a Rails application, create an initializer ```config/initializers/omniauth.rb```:
|
39
49
|
|
40
50
|
```ruby
|
41
51
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
42
|
-
|
52
|
+
private_key = OpenSSL::PKey::RSA.new(IO.read('<PRIVATE KEY FILENAME>'), ENV['key_passphrase'])
|
53
|
+
|
54
|
+
provider :vatsim, 'Consumer Key', private_key.to_pem,
|
43
55
|
site: 'https://cert.vatsim.net/sso',
|
44
56
|
signature_method: 'RSA-SHA1',
|
45
|
-
private_key:
|
57
|
+
private_key: private_key
|
46
58
|
end
|
47
59
|
```
|
48
60
|
|
49
61
|
For a Rails application using [Devise](https://github.com/plataformatec/devise), modify ```config/initializers/devise.rb```:
|
50
62
|
|
51
63
|
```ruby
|
52
|
-
|
64
|
+
private_key = OpenSSL::PKey::RSA.new(IO.read('<PRIVATE KEY FILENAME>'), ENV['key_passphrase'])
|
65
|
+
|
66
|
+
config.omniauth :vatsim, 'Consumer Key', private_key,
|
53
67
|
client_options: {
|
54
68
|
site: 'https://cert.vatsim.net/sso',
|
55
69
|
signature_method: 'RSA-SHA1',
|
56
|
-
private_key:
|
70
|
+
private_key: private_key
|
57
71
|
}
|
58
72
|
```
|
59
73
|
|
@@ -61,11 +75,14 @@ For Sinatra you would add:
|
|
61
75
|
|
62
76
|
```ruby
|
63
77
|
use Rack::Session::Cookie
|
78
|
+
|
79
|
+
private_key = OpenSSL::PKey::RSA.new(IO.read('<PRIVATE KEY FILENAME>'), ENV['key_passphrase'])
|
80
|
+
|
64
81
|
use OmniAuth::Builder do
|
65
|
-
provider :vatsim, '
|
82
|
+
provider :vatsim, 'Consumer Key', private_key,
|
66
83
|
site: 'https://cert.vatsim.net/sso'
|
67
84
|
signature_method: 'RSA-SHA1',
|
68
|
-
private_key:
|
85
|
+
private_key: private_key
|
69
86
|
end
|
70
87
|
```
|
71
88
|
|
@@ -75,14 +92,14 @@ For a Rails application, create an initializer ```config/initializers/omniauth.r
|
|
75
92
|
|
76
93
|
```ruby
|
77
94
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
78
|
-
provider :vatsim, '
|
95
|
+
provider :vatsim, 'Consumer Key', 'Consumer Secret', site: 'https://cert.vatsim.net/sso'
|
79
96
|
end
|
80
97
|
```
|
81
98
|
|
82
99
|
For a Rails application using [Devise](https://github.com/plataformatec/devise), modify ```config/initializers/devise.rb```:
|
83
100
|
|
84
101
|
```ruby
|
85
|
-
config.omniauth :vatsim, '
|
102
|
+
config.omniauth :vatsim, 'Consumer Key', 'Consumer Secret', client_options: {site: 'https://cert.vatsim.net/sso'}
|
86
103
|
```
|
87
104
|
|
88
105
|
For Sinatra you would add:
|
@@ -90,7 +107,7 @@ For Sinatra you would add:
|
|
90
107
|
```ruby
|
91
108
|
use Rack::Session::Cookie
|
92
109
|
use OmniAuth::Builder do
|
93
|
-
provider :vatsim, '
|
110
|
+
provider :vatsim, 'Consumer Key', 'Consumer Secret', site: 'https://cert.vatsim.net/sso'
|
94
111
|
end
|
95
112
|
```
|
96
113
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-vatsim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan P. Voss
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multi_json
|