omniauth-infinum_azure 0.1.4 → 0.1.6

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: 8c0cfbd150059fb6878bc374878fc0b70586769f8d774e437164fa019b64827c
4
- data.tar.gz: 9ee1bf51c4d0e2778129da93dbfbdfb828cf67ebc559ac66f6c4594145af1891
3
+ metadata.gz: 11a7f4da942b1ebf249700e61fe5a36d356529a31c2bfb530da08dd920f08518
4
+ data.tar.gz: 79f93a08ac73c51b5c35bd21a60dc47686fd46548a4e2a2e55236459792c5203
5
5
  SHA512:
6
- metadata.gz: 91cc81adea8aa691c1da4f68d2479eb23525bf7b51ba86b83fed10d228f9eba5772de39b0f3446970c869fb04e9c2c06c7da5115bc0083f8c88eb2725536b168
7
- data.tar.gz: 687428f5c95a1e8743770bdb84af6666fbb81beb3538b5de04b0edeff39c6898b99295aa2dc528612c0f00c04a9f36d34626109151c5a8751c3557cdfdef9a03
6
+ metadata.gz: 04b0d14a591a242651851227cf472a708b58961dabc45c5f4282f578dc9a0ea84b8922813be0e7895afcb5096ff392868671d9e8cc744d8cf6f35d8c7fdacf4c
7
+ data.tar.gz: 62cc9c8e4d60b812770b301bfe302eef35dba0c3e841aff6d6d4d33db3691d8543023df19a61552130e650179a3ce1f55ce111ddd3aeb6bccded4fd1312e6028
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.6] - 2023-03-15
4
+
5
+ - Raise error if tenant not provided
6
+
7
+ ## [0.1.5] - 2023-03-14
8
+
9
+ - Read tenant from client options
10
+
3
11
  ## [0.1.4] - 2023-03-14
4
12
 
5
13
  - Moving options to client options
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omniauth-infinum_azure (0.1.4)
4
+ omniauth-infinum_azure (0.1.6)
5
5
  omniauth-oauth2
6
6
 
7
7
  GEM
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Omniauth
4
4
  module InfinumAzure
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.6'
6
6
  end
7
7
  end
@@ -4,14 +4,8 @@ module OmniAuth
4
4
  module Strategies
5
5
  class InfinumAzure < OmniAuth::Strategies::OAuth2
6
6
  option :name, 'infinum_azure'
7
-
8
- option :client_options, tenant: 'infinumtest'
9
- option :client_options, policy: 'B2C_1_sign_in'
10
- option :client_options, scope: 'openid'
11
-
12
- def base_azure_url
13
- "https://#{options.tenant}.b2clogin.com/#{options.tenant}.onmicrosoft.com/#{options.policy}/oauth2/v2.0"
14
- end
7
+ option :policy, 'B2C_1_sign_in'
8
+ option :scope, 'openid'
15
9
 
16
10
  def client
17
11
  options.client_options.authorize_url = File.join(base_azure_url, 'authorize')
@@ -20,8 +14,14 @@ module OmniAuth
20
14
  super
21
15
  end
22
16
 
23
- def logout_url
24
- File.join(base_azure_url, 'logout') + "?post_logout_redirect_uri=#{File.join(full_host, path_prefix, 'logout')}"
17
+ def base_azure_url
18
+ raise 'Tenant not provided' if tenant.nil?
19
+
20
+ "https://#{tenant}.b2clogin.com/#{tenant}.onmicrosoft.com/#{options.policy}/oauth2/v2.0"
21
+ end
22
+
23
+ def tenant
24
+ options.client_options.tenant
25
25
  end
26
26
 
27
27
  def other_phase
@@ -30,6 +30,10 @@ module OmniAuth
30
30
  redirect(logout_url)
31
31
  end
32
32
 
33
+ def logout_url
34
+ File.join(base_azure_url, 'logout') + "?post_logout_redirect_uri=#{File.join(full_host, path_prefix, 'logout')}"
35
+ end
36
+
33
37
  uid do
34
38
  raw_info['sub']
35
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-infinum_azure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marko Ćilimković
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-14 00:00:00.000000000 Z
11
+ date: 2023-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler