omniauth-azure-activedirectory-v2 0.1.1 → 2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +34 -0
- data/CODE_OF_CONDUCT.md +1 -1
- data/README.md +7 -3
- data/lib/omniauth/azure_activedirectory_v2/version.rb +2 -1
- data/lib/omniauth/strategies/azure_activedirectory_v2.rb +31 -10
- data/omniauth-azure-activedirectory-v2.gemspec +48 -28
- metadata +11 -14
- data/.gitignore +0 -16
- data/.rspec +0 -3
- data/.travis.yml +0 -6
- data/Rakefile +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6292ee8af704acb7005d47fa78c9ebae4ae9e49bc677dcaff08e087560004013
|
4
|
+
data.tar.gz: 418effa55080e12e2371804f2634c67977c782c7fa9a4bbb3fafbae253e69307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89d6e827e31cb60be2c30fbc464360bc355b0381ec653874535125da81fa596e7c2ec43134183417c8ff29ce631737e0ce2bb79ff1876354a67a45fd1eccbef6
|
7
|
+
data.tar.gz: 5e551b04a716d10745cd913af183ba1997c705f16edb39e925c2cdff59b4905a39b113c333fa2f1b927179eef58383be150c6012f31627e5f14776830f6dacf5
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## v2.0.0 (2022-09-14)
|
4
|
+
|
5
|
+
Makes compatible with OmniAuth 2 and requires it.
|
6
|
+
|
7
|
+
Note: https://github.com/RIPAGlobal/omniauth-azure-activedirectory-v2/pull/6 for reasoning - Thanks @jessieay
|
8
|
+
|
9
|
+
_Major version bump as no longer supports Omniauth 1._
|
10
|
+
|
11
|
+
## v1.0.0 (2020-09-25)
|
12
|
+
|
13
|
+
Removes use of the https://graph.microsoft.com/v1.0/me API.
|
14
|
+
|
15
|
+
* One of the key differences for the V2 API vs V1 is the differences
|
16
|
+
between who can sign with the addition of Personal Accounts - see:
|
17
|
+
https://nicolgit.github.io/AzureAD-Endopoint-V1-vs-V2-comparison/
|
18
|
+
|
19
|
+
- In testing we found that these accounts may not have access to
|
20
|
+
this endpoint
|
21
|
+
- All the data provided in `info` exists in the JWT anyway, so this
|
22
|
+
cuts down on API calls
|
23
|
+
|
24
|
+
* Conforms to the Omniauth Auth Hash Schema (1.0 and later) - see:
|
25
|
+
https://github.com/omniauth/omniauth/wiki/Auth-Hash-Schema
|
26
|
+
|
27
|
+
- Expose `raw_info`
|
28
|
+
- Remove `id` from `info`
|
29
|
+
- *NB: This could be a breaking change for some, but most will
|
30
|
+
already be using the correct property name of `uid`.*
|
31
|
+
|
32
|
+
## v0.1.1 (2020-09-23)
|
33
|
+
|
34
|
+
- First release.
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at
|
58
|
+
reported by contacting the project team at dev@ripglobal.com. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/README.md
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
# Omniauth::Azure::Activedirectory::V2
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/omniauth-azure-activedirectory-v2)
|
4
|
+
[](https://travis-ci.org/RIPGlobal/omniauth-azure-activedirectory-v2)
|
5
|
+
[](LICENSE.md)
|
6
|
+
|
3
7
|
OAuth 2 authentication with [Azure ActiveDirectory's V2 API](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview). Rationale:
|
4
8
|
|
5
9
|
* https://github.com/marknadig/omniauth-azure-oauth2 is no longer maintained.
|
6
10
|
* https://github.com/marknadig/omniauth-azure-oauth2/pull/29 contains important additions.
|
7
11
|
|
8
|
-
This gem combines the two.
|
12
|
+
This gem combines the two and makes some changes to support the full V2 API.
|
9
13
|
|
10
14
|
The ActiveDirectory V1 auth API used OpenID Connect. If you need this, a gem from Microsoft [is available here](https://github.com/AzureAD/omniauth-azure-activedirectory), but seems to be abandoned.
|
11
15
|
|
@@ -37,7 +41,7 @@ See https://github.com/marknadig/omniauth-azure-oauth2 for background informatio
|
|
37
41
|
|
38
42
|
## Contributing
|
39
43
|
|
40
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2. This project is intended to be a safe, welcoming space for collaboration so contributors must adhere to the [code of conduct](https://github.com/
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2. This project is intended to be a safe, welcoming space for collaboration so contributors must adhere to the [code of conduct](https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2/blob/master/CODE_OF_CONDUCT.md).
|
41
45
|
|
42
46
|
|
43
47
|
|
@@ -49,4 +53,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
49
53
|
|
50
54
|
## Code of Conduct
|
51
55
|
|
52
|
-
Everyone interacting in this project's codebases, issue trackers, chat rooms and mailing lists must follow the [code of conduct](https://github.com/
|
56
|
+
Everyone interacting in this project's codebases, issue trackers, chat rooms and mailing lists must follow the [code of conduct](https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2/blob/master/CODE_OF_CONDUCT.md).
|
@@ -9,7 +9,6 @@ module OmniAuth
|
|
9
9
|
option :tenant_provider, nil
|
10
10
|
|
11
11
|
DEFAULT_SCOPE = 'openid profile email'
|
12
|
-
USER_INFO_URL = 'https://graph.microsoft.com/v1.0/me'
|
13
12
|
|
14
13
|
# tenant_provider must return client_id, client_secret and optionally tenant_id and base_azure_url
|
15
14
|
args [:tenant_provider]
|
@@ -40,27 +39,49 @@ module OmniAuth
|
|
40
39
|
end
|
41
40
|
|
42
41
|
uid {
|
43
|
-
raw_info['
|
42
|
+
raw_info['oid']
|
44
43
|
}
|
45
44
|
|
46
45
|
info do
|
47
46
|
{
|
48
|
-
name: raw_info['
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
47
|
+
name: raw_info['name'],
|
48
|
+
email: raw_info['email'] || raw_info['upn'],
|
49
|
+
nickname: raw_info['unique_name'],
|
50
|
+
first_name: raw_info['given_name'],
|
51
|
+
last_name: raw_info['family_name']
|
53
52
|
}
|
54
53
|
end
|
55
54
|
|
55
|
+
extra do
|
56
|
+
{ raw_info: raw_info }
|
57
|
+
end
|
58
|
+
|
56
59
|
def callback_url
|
57
|
-
full_host +
|
60
|
+
full_host + callback_path
|
58
61
|
end
|
59
62
|
|
63
|
+
# https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens
|
64
|
+
#
|
65
|
+
# Some account types from Microsoft seem to only have a decodable ID token,
|
66
|
+
# with JWT unable to decode the access token. Information is limited in those
|
67
|
+
# cases. Other account types provide an expanded set of data inside the auth
|
68
|
+
# token, which does decode as a JWT.
|
69
|
+
#
|
70
|
+
# Merge the two, allowing the expanded auth token data to overwrite the ID
|
71
|
+
# token data if keys collide, and use this as raw info.
|
72
|
+
#
|
60
73
|
def raw_info
|
61
|
-
@raw_info
|
74
|
+
if @raw_info.nil?
|
75
|
+
id_token_data = ::JWT.decode(access_token.params['id_token'], nil, false).first rescue {}
|
76
|
+
auth_token_data = ::JWT.decode(access_token.token, nil, false).first rescue {}
|
77
|
+
|
78
|
+
id_token_data.merge!(auth_token_data)
|
79
|
+
@raw_info = id_token_data
|
80
|
+
end
|
81
|
+
|
82
|
+
@raw_info
|
62
83
|
end
|
63
84
|
|
64
85
|
end
|
65
86
|
end
|
66
|
-
end
|
87
|
+
end
|
@@ -1,29 +1,49 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
# stub: omniauth-azure-activedirectory-v2 1.0.0 ruby lib
|
4
|
+
|
5
|
+
$:.push File.expand_path( '../lib', __FILE__ )
|
6
|
+
require 'omniauth/azure_activedirectory_v2/version'
|
7
|
+
|
8
|
+
# https://guides.rubygems.org/specification-reference/
|
9
|
+
#
|
10
|
+
Gem::Specification.new do |s|
|
11
|
+
s.name = 'omniauth-azure-activedirectory-v2'
|
12
|
+
s.version = Omniauth::Azure::Activedirectory::V2::VERSION
|
13
|
+
s.date = Omniauth::Azure::Activedirectory::V2::DATE
|
14
|
+
s.summary = 'OAuth 2 authentication with the Azure ActiveDirectory V2 API.'
|
15
|
+
s.authors = [ 'RIP Global' ]
|
16
|
+
s.email = [ 'dev@ripglobal.com' ]
|
17
|
+
s.licenses = [ 'MIT' ]
|
18
|
+
s.homepage = 'https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2'
|
19
|
+
|
20
|
+
s.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
21
|
+
s.require_paths = ['lib']
|
22
|
+
s.bindir = 'exe'
|
23
|
+
s.files = %w{
|
24
|
+
README.md
|
25
|
+
CHANGELOG.md
|
26
|
+
CODE_OF_CONDUCT.md
|
27
|
+
LICENSE.txt
|
28
|
+
|
29
|
+
Gemfile
|
30
|
+
bin/console
|
31
|
+
bin/setup
|
32
|
+
|
33
|
+
lib/omniauth-azure-activedirectory-v2.rb
|
34
|
+
lib/omniauth/azure_activedirectory_v2.rb
|
35
|
+
lib/omniauth/azure_activedirectory_v2/version.rb
|
36
|
+
lib/omniauth/strategies/azure_activedirectory_v2.rb
|
37
|
+
|
38
|
+
omniauth-azure-activedirectory-v2.gemspec
|
39
|
+
}
|
40
|
+
|
41
|
+
s.metadata = {
|
42
|
+
'homepage_uri' => 'https://www.ripglobal.com/',
|
43
|
+
'bug_tracker_uri' => 'https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2/issues/',
|
44
|
+
'changelog_uri' => 'https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2/blob/master/CHANGELOG.md',
|
45
|
+
'source_code_uri' => 'https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2'
|
46
|
+
}
|
47
|
+
|
48
|
+
s.add_runtime_dependency('omniauth-oauth2', '~> 1.8')
|
29
49
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-azure-activedirectory-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RIP Global
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.8'
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- dev@ripglobal.com
|
@@ -31,14 +31,11 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
-
|
35
|
-
- ".rspec"
|
36
|
-
- ".travis.yml"
|
34
|
+
- CHANGELOG.md
|
37
35
|
- CODE_OF_CONDUCT.md
|
38
36
|
- Gemfile
|
39
37
|
- LICENSE.txt
|
40
38
|
- README.md
|
41
|
-
- Rakefile
|
42
39
|
- bin/console
|
43
40
|
- bin/setup
|
44
41
|
- lib/omniauth-azure-activedirectory-v2.rb
|
@@ -50,10 +47,10 @@ homepage: https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2
|
|
50
47
|
licenses:
|
51
48
|
- MIT
|
52
49
|
metadata:
|
53
|
-
homepage_uri: https://
|
54
|
-
source_code_uri: https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2
|
50
|
+
homepage_uri: https://www.ripglobal.com/
|
55
51
|
bug_tracker_uri: https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2/issues/
|
56
52
|
changelog_uri: https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2/blob/master/CHANGELOG.md
|
53
|
+
source_code_uri: https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2
|
57
54
|
post_install_message:
|
58
55
|
rdoc_options: []
|
59
56
|
require_paths:
|
@@ -69,8 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
66
|
- !ruby/object:Gem::Version
|
70
67
|
version: '0'
|
71
68
|
requirements: []
|
72
|
-
rubygems_version: 3.
|
69
|
+
rubygems_version: 3.3.7
|
73
70
|
signing_key:
|
74
71
|
specification_version: 4
|
75
|
-
summary: OAuth 2 authentication with Azure ActiveDirectory
|
72
|
+
summary: OAuth 2 authentication with the Azure ActiveDirectory V2 API.
|
76
73
|
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED