omniauth-microsoft_graph 0.3.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of omniauth-microsoft_graph might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/.github/FUNDING.yml +3 -0
- data/.github/workflows/ruby.yml +33 -0
- data/README.md +4 -1
- data/lib/omniauth/microsoft_graph/version.rb +2 -2
- data/lib/omniauth/strategies/microsoft_graph.rb +1 -1
- data/omniauth-microsoft_graph.gemspec +3 -3
- data/spec/omniauth/strategies/microsoft_graph_oauth2_spec.rb +7 -1
- metadata +9 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: daf7c5be94277e563c664c962a3672e4a69e0548ae65ab73aa7065fbf972e706
|
4
|
+
data.tar.gz: 35c5549de0d4c74f5579e36f9210b4127df997c35ec364105522099a256df96c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a0955a3ba852113b1682de6ba56fa3386d2f52e795f0faa0d35864bf1c549c4b8711dffdfbf8763d3db6167cf24cb69747bace1b597882d25ddf98dda2b0a4b
|
7
|
+
data.tar.gz: '09d94fcd169a460597fc56f9836b5053fc4a10d0aed49becaca63c28e6b3cddcf98fa1c1605b90b693f8f541101dafdd8305a840de7952e0a06ebb1c96665992'
|
data/.github/FUNDING.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
pull_request:
|
13
|
+
|
14
|
+
jobs:
|
15
|
+
test:
|
16
|
+
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
strategy:
|
19
|
+
matrix:
|
20
|
+
ruby-version: ['2.6', '2.7', '3.0']
|
21
|
+
|
22
|
+
steps:
|
23
|
+
- uses: actions/checkout@v2
|
24
|
+
- name: Set up Ruby
|
25
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
26
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
27
|
+
# uses: ruby/setup-ruby@v1
|
28
|
+
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby-version }}
|
31
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
32
|
+
- name: Run tests
|
33
|
+
run: bundle exec rake
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
# Omniauth::MicrosoftGraph
|
1
|
+
# Omniauth::MicrosoftGraph ![ruby workflow](https://github.com/synth/omniauth-microsoft_graph/actions/workflows/ruby.yml/badge.svg)
|
2
|
+
|
2
3
|
|
3
4
|
Microsoft Graph OAuth2 Strategy for OmniAuth.
|
4
5
|
Can be used to authenticate with Office365 or other MS services, and get a token for the Microsoft Graph Api, formerly the Office365 Unified Api.
|
@@ -33,6 +34,8 @@ Just add {login_hint: "email@example.com"} to your url generation to form:
|
|
33
34
|
```ruby
|
34
35
|
/auth/microsoft_graph?login_hint=email@example.com
|
35
36
|
```
|
37
|
+
### Upgrading to 1.0.0
|
38
|
+
This version requires OmniAuth v2. If you are using Rails, you will need to include or upgrade `omniauth-rails_csrf_protection`. If you upgrade and get an error in your logs complaining about "authenticity error" or similiar, make sure to do `bundle update omniauth-rails_csrf_protection`
|
36
39
|
|
37
40
|
## Contributing
|
38
41
|
|
@@ -89,7 +89,7 @@ module OmniAuth
|
|
89
89
|
verifier = body && body['code']
|
90
90
|
client_get_token(verifier, '/auth/microsoft_graph/callback') if verifier
|
91
91
|
rescue JSON::ParserError => e
|
92
|
-
warn "[omniauth
|
92
|
+
warn "[omniauth microsoft_graph] JSON parse error=#{e}"
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
@@ -5,7 +5,7 @@ require 'omniauth/microsoft_graph/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "omniauth-microsoft_graph"
|
8
|
-
spec.version =
|
8
|
+
spec.version = OmniAuth::MicrosoftGraph::VERSION
|
9
9
|
spec.authors = ["Peter Philips", "Joel Van Horn"]
|
10
10
|
spec.email = ["pete@p373.net", "joel@joelvanhorn.com"]
|
11
11
|
spec.summary = %q{omniauth provider for Microsoft Graph}
|
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency 'omniauth', '~>
|
22
|
-
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.
|
21
|
+
spec.add_runtime_dependency 'omniauth', '~> 2.0'
|
22
|
+
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.7.1'
|
23
23
|
spec.add_development_dependency "sinatra", '~> 0'
|
24
24
|
spec.add_development_dependency "rake", '~> 12.3.3', '>= 12.3.3'
|
25
25
|
spec.add_development_dependency 'rspec', '~> 3.6'
|
@@ -151,7 +151,7 @@ describe OmniAuth::Strategies::MicrosoftGraph do
|
|
151
151
|
end
|
152
152
|
|
153
153
|
it 'should set default scope to email,profile' do
|
154
|
-
expect(subject.authorize_params['scope']).to eq('openid email profile https://graph.microsoft.com/User.Read')
|
154
|
+
expect(subject.authorize_params['scope']).to eq('offline_access openid email profile https://graph.microsoft.com/User.Read')
|
155
155
|
end
|
156
156
|
|
157
157
|
it 'should support space delimited scopes' do
|
@@ -243,6 +243,7 @@ describe OmniAuth::Strategies::MicrosoftGraph do
|
|
243
243
|
|
244
244
|
describe '#callback_path' do
|
245
245
|
it 'has the correct default callback path' do
|
246
|
+
allow(subject).to receive(:script_name).and_return('')
|
246
247
|
expect(subject.callback_path).to eq('/auth/microsoft_graph/callback')
|
247
248
|
end
|
248
249
|
|
@@ -250,6 +251,11 @@ describe OmniAuth::Strategies::MicrosoftGraph do
|
|
250
251
|
@options = { callback_path: '/auth/foo/callback' }
|
251
252
|
expect(subject.callback_path).to eq('/auth/foo/callback')
|
252
253
|
end
|
254
|
+
|
255
|
+
it 'should set the callback_path with script_name if present' do
|
256
|
+
allow(subject).to receive(:script_name).and_return('/api/v1')
|
257
|
+
expect(subject.callback_path).to eq('/api/v1/auth/microsoft_graph/callback')
|
258
|
+
end
|
253
259
|
end
|
254
260
|
|
255
261
|
describe '#info' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-microsoft_graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Philips
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-04-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
@@ -17,34 +17,28 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 1.1.1
|
20
|
+
version: '2.0'
|
24
21
|
type: :runtime
|
25
22
|
prerelease: false
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
27
24
|
requirements:
|
28
25
|
- - "~>"
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
version: '
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1.1
|
27
|
+
version: '2.0'
|
34
28
|
- !ruby/object:Gem::Dependency
|
35
29
|
name: omniauth-oauth2
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|
37
31
|
requirements:
|
38
32
|
- - "~>"
|
39
33
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
34
|
+
version: 1.7.1
|
41
35
|
type: :runtime
|
42
36
|
prerelease: false
|
43
37
|
version_requirements: !ruby/object:Gem::Requirement
|
44
38
|
requirements:
|
45
39
|
- - "~>"
|
46
40
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
41
|
+
version: 1.7.1
|
48
42
|
- !ruby/object:Gem::Dependency
|
49
43
|
name: sinatra
|
50
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,6 +109,8 @@ executables: []
|
|
115
109
|
extensions: []
|
116
110
|
extra_rdoc_files: []
|
117
111
|
files:
|
112
|
+
- ".github/FUNDING.yml"
|
113
|
+
- ".github/workflows/ruby.yml"
|
118
114
|
- ".travis.yml"
|
119
115
|
- CHANGELOG.md
|
120
116
|
- Gemfile
|
@@ -148,8 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
144
|
- !ruby/object:Gem::Version
|
149
145
|
version: '0'
|
150
146
|
requirements: []
|
151
|
-
|
152
|
-
rubygems_version: 2.5.2
|
147
|
+
rubygems_version: 3.1.6
|
153
148
|
signing_key:
|
154
149
|
specification_version: 4
|
155
150
|
summary: omniauth provider for Microsoft Graph
|