omniauth-microsoft_graph 0.3.0 → 1.0.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.

Potentially problematic release.


This version of omniauth-microsoft_graph might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d5fb7e4f89d46058d18c857dbe0935cbf720c802
4
- data.tar.gz: 29291329512d0d36bad6e0ff1a3917f842a4b83c
2
+ SHA256:
3
+ metadata.gz: 3b44d91f86e5b9e5ab57466bf82a98dd57d1f02739d2849e010fe4291be36598
4
+ data.tar.gz: 5007297df1581f6a1c530bb45f8d452cb00d7943fd06329131a7048eb48c3b0d
5
5
  SHA512:
6
- metadata.gz: 339872f74676b8269b0a92c46f56bdb8b350a6fe64df495bd23a8580ed45645b258bd181bbb82ab68faa362de0a9b1823bd25e71a0ba60a629d4e517fe33cbf5
7
- data.tar.gz: b562fde6e3529990b1caa343c7044f7ae3dd02d66c41065aa6332c8282290397f21a310080f109581784dbd58b91f3ea2a5662518326705e47fac38727de4ef4
6
+ metadata.gz: a7a505dcd6516579f58bd406b6bde6656eb49d143fd65e89255ea7170269d3bff235c9775f72a71a69266fa5515d34a8a1e5d87d5ac3c842e36a283683237bd1
7
+ data.tar.gz: 4202e44174712058a256319a7e856ea2efabc822ca8293c45ee7d994b6b5ba5ae09454a768c90b187d3c5ab1942a965af4a6a29beb789e063858c11e9fb9361a
@@ -0,0 +1,35 @@
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
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.6', '2.7', '3.0']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ # uses: ruby/setup-ruby@v1
30
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
+ - name: Run tests
35
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # Omniauth::MicrosoftGraph [![Build Status](https://travis-ci.org/synth/omniauth-microsoft_graph.svg?branch=master)](https://travis-ci.org/synth/omniauth-microsoft_graph)
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.
@@ -21,12 +22,21 @@ Or install it yourself as:
21
22
 
22
23
  ## Usage
23
24
 
25
+ #### Configuration
24
26
  ```ruby
25
27
  Rails.application.config.middleware.use OmniAuth::Builder do
26
28
  provider :microsoft_graph, ENV['AZURE_APPLICATION_CLIENT_ID'], ENV['AZURE_APPLICATION_CLIENT_SECRET']
27
29
  end
28
30
  ```
29
31
 
32
+ #### Login Hint
33
+ Just add {login_hint: "email@example.com"} to your url generation to form:
34
+ ```ruby
35
+ /auth/microsoft_graph?login_hint=email@example.com
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`
39
+
30
40
  ## Contributing
31
41
 
32
42
  1. Fork it ( https://github.com/synth/omniauth-microsoft_graph/fork )
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module MicrosoftGraph
3
- VERSION = "0.3.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -5,7 +5,7 @@ module OmniAuth
5
5
  class MicrosoftGraph < OmniAuth::Strategies::OAuth2
6
6
  BASE_SCOPE_URL = 'https://graph.microsoft.com/'
7
7
  BASE_SCOPES = %w[offline_access openid email profile].freeze
8
- DEFAULT_SCOPE = 'openid email profile User.Read'.freeze
8
+ DEFAULT_SCOPE = 'offline_access openid email profile User.Read'.freeze
9
9
 
10
10
  option :name, :microsoft_graph
11
11
 
@@ -18,10 +18,10 @@ 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', '~> 1.1', '>= 1.1.1'
22
- spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.6'
21
+ spec.add_runtime_dependency 'omniauth', '~> 2.0.4'
22
+ spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.7.1'
23
23
  spec.add_development_dependency "sinatra", '~> 0'
24
- spec.add_development_dependency "rake", '~> 0'
24
+ spec.add_development_dependency "rake", '~> 12.3.3', '>= 12.3.3'
25
25
  spec.add_development_dependency 'rspec', '~> 3.6'
26
26
  spec.add_development_dependency "mocha", '~> 0'
27
27
  end
@@ -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,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-microsoft_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Philips
8
8
  - Joel Van Horn
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-17 00:00:00.000000000 Z
12
+ date: 2021-10-02 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: '1.1'
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 1.1.1
20
+ version: 2.0.4
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: '1.1'
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 1.1.1
27
+ version: 2.0.4
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: '1.6'
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: '1.6'
41
+ version: 1.7.1
48
42
  - !ruby/object:Gem::Dependency
49
43
  name: sinatra
50
44
  requirement: !ruby/object:Gem::Requirement
@@ -65,14 +59,20 @@ dependencies:
65
59
  requirements:
66
60
  - - "~>"
67
61
  - !ruby/object:Gem::Version
68
- version: '0'
62
+ version: 12.3.3
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 12.3.3
69
66
  type: :development
70
67
  prerelease: false
71
68
  version_requirements: !ruby/object:Gem::Requirement
72
69
  requirements:
73
70
  - - "~>"
74
71
  - !ruby/object:Gem::Version
75
- version: '0'
72
+ version: 12.3.3
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 12.3.3
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rspec
78
78
  requirement: !ruby/object:Gem::Requirement
@@ -109,6 +109,7 @@ executables: []
109
109
  extensions: []
110
110
  extra_rdoc_files: []
111
111
  files:
112
+ - ".github/workflows/ruby.yml"
112
113
  - ".travis.yml"
113
114
  - CHANGELOG.md
114
115
  - Gemfile
@@ -127,7 +128,7 @@ homepage: https://github.com/synth/omniauth-microsoft_graph
127
128
  licenses:
128
129
  - MIT
129
130
  metadata: {}
130
- post_install_message:
131
+ post_install_message:
131
132
  rdoc_options: []
132
133
  require_paths:
133
134
  - lib
@@ -142,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.5.2
147
- signing_key:
146
+ rubygems_version: 3.1.4
147
+ signing_key:
148
148
  specification_version: 4
149
149
  summary: omniauth provider for Microsoft Graph
150
150
  test_files: