omniauth-infinum_azure 0.1.5 → 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: '0178441ee865dcc137189f779e7eae305e5ca5f870e040e427b9b999a41fbe9a'
4
- data.tar.gz: d15f11359e2add574be59594631397604b876bcffb411eba971be830af7b3ece
3
+ metadata.gz: 11a7f4da942b1ebf249700e61fe5a36d356529a31c2bfb530da08dd920f08518
4
+ data.tar.gz: 79f93a08ac73c51b5c35bd21a60dc47686fd46548a4e2a2e55236459792c5203
5
5
  SHA512:
6
- metadata.gz: cd379ff423fbf4f312c0839e5d83f96ab7be8f0b9b3c389e3623837062903f9bd2789b27af82b211ec722efe84cb38b5c5a4b4451246f5f0bfbfb99a484f1727
7
- data.tar.gz: d6f08b74f57bfe0061c6b2bdca4fc3c0d9b94a3b87b70933eba55254045a3b75f7d4368ff38215348d5d984d5aa6123f3db091b7dd65bf47e0f9bbde3266137b
6
+ metadata.gz: 04b0d14a591a242651851227cf472a708b58961dabc45c5f4282f578dc9a0ea84b8922813be0e7895afcb5096ff392868671d9e8cc744d8cf6f35d8c7fdacf4c
7
+ data.tar.gz: 62cc9c8e4d60b812770b301bfe302eef35dba0c3e841aff6d6d4d33db3691d8543023df19a61552130e650179a3ce1f55ce111ddd3aeb6bccded4fd1312e6028
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.6] - 2023-03-15
4
+
5
+ - Raise error if tenant not provided
6
+
3
7
  ## [0.1.5] - 2023-03-14
4
8
 
5
9
  - Read tenant from 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.5)
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.5'
5
+ VERSION = '0.1.6'
6
6
  end
7
7
  end
@@ -7,14 +7,6 @@ module OmniAuth
7
7
  option :policy, 'B2C_1_sign_in'
8
8
  option :scope, 'openid'
9
9
 
10
- def base_azure_url
11
- "https://#{tenant}.b2clogin.com/#{tenant}.onmicrosoft.com/#{options.policy}/oauth2/v2.0"
12
- end
13
-
14
- def tenant
15
- options.client_options.tenant || 'tenant_not_provided'
16
- end
17
-
18
10
  def client
19
11
  options.client_options.authorize_url = File.join(base_azure_url, 'authorize')
20
12
  options.client_options.token_url = File.join(base_azure_url, 'token')
@@ -22,8 +14,14 @@ module OmniAuth
22
14
  super
23
15
  end
24
16
 
25
- def logout_url
26
- 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
27
25
  end
28
26
 
29
27
  def other_phase
@@ -32,6 +30,10 @@ module OmniAuth
32
30
  redirect(logout_url)
33
31
  end
34
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
+
35
37
  uid do
36
38
  raw_info['sub']
37
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.5
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