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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b52c390454c367f391288e009cbf53a22b159daf
4
- data.tar.gz: e22e722792fc7f34270eddb2b00223847770a46f
3
+ metadata.gz: c26ba6c5cced00dd267e6316e190f959834db29c
4
+ data.tar.gz: 4e7e6a96c6a05c6db96988356ccb848ff3d2883c
5
5
  SHA512:
6
- metadata.gz: 3f462f9b676eb155ae8918d4b47a924fada515bea021610ae64ce6d475328f76b7f16f3c9c0fbb45177b146bcb6a21660fba3bb1ec4abed157212cde32e15fd1
7
- data.tar.gz: 2adb7e7437667337092b2cd1c6ce25435b76f1417327b247a67cddb168577a177dbd632a836df1d6592f91a8420accef5c745eb5585297894fa10cbf2a96be38
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
- provider :vatsim, 'app_id', nil,
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: OpenSSL::PKey::RSA.new(IO.read('<PRIVATE KEY FILENAME>'), ENV['key_passphrase'])
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
- config.omniauth :vatsim, 'app_id', nil,
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: OpenSSL::PKey::RSA.new(IO.read('<PRIVATE KEY FILENAME>'), ENV['key_passphrase'])
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, 'api_id', nil,
82
+ provider :vatsim, 'Consumer Key', private_key,
66
83
  site: 'https://cert.vatsim.net/sso'
67
84
  signature_method: 'RSA-SHA1',
68
- private_key: OpenSSL::PKey::RSA.new(IO.read('<PRIVATE KEY FILENAME>'), ENV['key_passphrase'])
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, 'app_id', 'app_secret', site: 'https://cert.vatsim.net/sso'
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, 'app_id', 'app_secret', client_options: {site: 'https://cert.vatsim.net/sso'}
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, 'api_id', 'api_secret', site: 'https://cert.vatsim.net/sso'
110
+ provider :vatsim, 'Consumer Key', 'Consumer Secret', site: 'https://cert.vatsim.net/sso'
94
111
  end
95
112
  ```
96
113
 
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Vatsim
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -8,6 +8,7 @@ module OmniAuth
8
8
 
9
9
  option :client_options, {
10
10
  site: 'http://sso.hardern.net/server', # default to demo site
11
+ scheme: :body,
11
12
  authorize_path: '/auth/pre_login/?',
12
13
  request_token_path: '/api/login_token',
13
14
  access_token_path: '/api/login_return',
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.5
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-08 00:00:00.000000000 Z
11
+ date: 2017-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multi_json