omniauth-azure-activedirectory-v2 2.1.0 → 2.2.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
  SHA256:
3
- metadata.gz: 82d3c5122483452eb3e9b37dba4ae4faab9ccad50e343e8f91834ee87771bcb2
4
- data.tar.gz: 75cb855f9c40ea1d0d3186dc3282ad89e6054c1da576e8b9d5e5983a5b617a85
3
+ metadata.gz: 4d83e537b36b58ba370dad64ad70f74eed7d9c46e040bc22e2bd4881618d41fd
4
+ data.tar.gz: 2b0f73ad03dbb4d1603994f015639532547742ed8f99aa02bbb69f3b4383058a
5
5
  SHA512:
6
- metadata.gz: d26b6339a494b85458791b95b52302456f34930d1ea9dd445fdb24b3eda589602ffb5088bfa2ec8c37a71238317c82759dd07b30f0ae4975c2b295bc3ca6e5eb
7
- data.tar.gz: 6d1ca0c3c8e6946c2a40cbf3939ab6da98e6f6004a600f09b5096d8a2dc0e65643d0b2028d80c5ce91ca5d7f29998c1cec34d4989b6d01d9c070008dfea1e1d0
6
+ metadata.gz: 7311d8d6538068f6181f1ac78a24ed315b96343a263aa0137d1a7ca31cd15b3f161664030c1966d8abfee40717924640d3ac2bd9534fbca8322844479c2c2339
7
+ data.tar.gz: 4913177aa072ac5c04d74a3e121bf04ceb668c0ae53ebc0938849a265c7f6f4e6d12a23085273d4230fb82d8a2f237d889488970792056dc37ad255bb71978f8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## v2.2.0 (2024-07-09)
4
+
5
+ [Implements](https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/pull/26) support for specifying `scope` via the authorisation URL, in addition to the prior support for static configuration or configuration via a custom provider class - thanks @nbgoodall!
6
+
3
7
  ## v2.1.0 (2023-09-16)
4
8
 
5
9
  [Implements](https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/pull/19) support for custom policies when using Microsoft Azure AD - thanks @stevenchanin!
data/Gemfile CHANGED
@@ -1,7 +1,5 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in omniauth-azure-activedirectory-v2.gemspec
4
+ #
4
5
  gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # OmniAuth::Azure::Activedirectory::V2
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/omniauth-azure-activedirectory-v2.svg)](https://badge.fury.io/rb/omniauth-azure-activedirectory-v2)
4
- [![Build Status](https://app.travis-ci.com/RIPAGlobal/omniauth-azure-activedirectory-v2.svg?branch=master)](https://app.travis-ci.com/github/RIPAGlobal/omniauth-azure-activedirectory-v2)
5
- [![License](https://img.shields.io/github/license/RIPAGlobal/omniauth-azure-activedirectory-v2.svg)](LICENSE.md)
3
+ [![Gem Version](https://badge.fury.io/rb/omniauth-azure-activedirectory-v2.svg)](https://rubygems.org/gems/omniauth-azure-activedirectory-v2)
4
+ [![Build Status](https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/actions/workflows/master.yml/badge.svg)](https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/actions)
5
+ [![License](https://img.shields.io/github/license/RIPAGlobal/omniauth-azure-activedirectory-v2.svg)](LICENSE.txt)
6
6
 
7
7
  OAuth 2 authentication with [Azure ActiveDirectory's V2 API](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview). Rationale:
8
8
 
@@ -25,12 +25,15 @@ gem 'omniauth-azure-activedirectory-v2'
25
25
 
26
26
  And then execute:
27
27
 
28
- $ bundle install
28
+ ```shell
29
+ $ bundle install
30
+ ```
29
31
 
30
32
  Or install it yourself as:
31
33
 
32
- $ gem install omniauth-azure-activedirectory-v2
33
-
34
+ ```shell
35
+ $ gem install omniauth-azure-activedirectory-v2
36
+ ```
34
37
 
35
38
 
36
39
  ## Usage
@@ -162,6 +165,14 @@ In method `#authorize_params` above, the request object is used to look for a `l
162
165
 
163
166
  > **NB:** Naming things is hard! The predecessor gem used the name `YouTenantProvider` since it was focused on custom tenant provision, but if using this in a more generic way, perhaps consider a more generic name such as, say, `CustomOmniAuthAzureProvider`.
164
167
 
168
+ #### Special case scope override
169
+
170
+ If required and more convenient, you can specify a custom `scope` value via generation of an authorisation URL including that required `scope`, rather than by using a custom provider class with `def scope...end` method. Include the `scope` value in your call to generate the URL thus:
171
+
172
+ ```ruby
173
+ omniauth_authorize_url('resource_name_eg_user', 'azure_activedirectory_v2', scope: '...')
174
+ ```
175
+
165
176
 
166
177
 
167
178
  ## Contributing
@@ -182,6 +193,8 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/RIPAGl
182
193
  * Add tests and check that `bundle exec rspec` still runs successfully
183
194
  * For new features (rather than bug fixes), update `README.md` with details
184
195
 
196
+
197
+
185
198
  ## License
186
199
 
187
200
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -2,8 +2,8 @@ module OmniAuth
2
2
  module Azure
3
3
  module Activedirectory
4
4
  module V2
5
- VERSION = "2.1.0"
6
- DATE = "2023-09-16"
5
+ VERSION = "2.2.0"
6
+ DATE = "2024-07-09"
7
7
  end
8
8
  end
9
9
  end
@@ -41,7 +41,9 @@ module OmniAuth
41
41
  options.authorize_params.prompt = request.params['prompt']
42
42
  end
43
43
 
44
- options.authorize_params.scope = if provider.respond_to?(:scope) && provider.scope
44
+ options.authorize_params.scope = if defined?(request) && request.params['scope']
45
+ request.params['scope']
46
+ elsif provider.respond_to?(:scope) && provider.scope
45
47
  provider.scope
46
48
  else
47
49
  DEFAULT_SCOPE
@@ -46,4 +46,7 @@ Gem::Specification.new do |s|
46
46
  }
47
47
 
48
48
  s.add_runtime_dependency('omniauth-oauth2', '~> 1.8')
49
+
50
+ s.add_development_dependency('rake', '~> 13.2 ')
51
+ s.add_development_dependency('rspec', '~> 3.13')
49
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-azure-activedirectory-v2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - RIPA Global
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-16 00:00:00.000000000 Z
11
+ date: 2024-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2
@@ -24,6 +24,34 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.8'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.2'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.13'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.13'
27
55
  description:
28
56
  email:
29
57
  - dev@ripaglobal.com
@@ -66,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
94
  - !ruby/object:Gem::Version
67
95
  version: '0'
68
96
  requirements: []
69
- rubygems_version: 3.4.4
97
+ rubygems_version: 3.5.11
70
98
  signing_key:
71
99
  specification_version: 4
72
100
  summary: OAuth 2 authentication with the Azure ActiveDirectory V2 API.