Class: OmniAuth::Strategies::InfinumAzure
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::InfinumAzure
- Defined in:
- lib/omniauth/strategies/infinum_azure.rb
Instance Method Summary collapse
- #azure_oauth_url ⇒ Object
-
#base_azure_url ⇒ Object
rubocop:disable Metrics/AbcSize.
-
#client ⇒ Object
rubocop:disable Metrics/AbcSize.
- #other_phase ⇒ Object
Instance Method Details
#azure_oauth_url ⇒ Object
23 24 25 |
# File 'lib/omniauth/strategies/infinum_azure.rb', line 23 def azure_oauth_url File.join(base_azure_url, 'oauth2/v2.0') end |
#base_azure_url ⇒ Object
rubocop:disable Metrics/AbcSize
27 28 29 30 31 32 |
# File 'lib/omniauth/strategies/infinum_azure.rb', line 27 def base_azure_url # rubocop:disable Metrics/AbcSize raise 'Domain not provided' if ..domain.nil? raise 'Tenant not provided' if ..tenant.nil? "#{..domain}/#{..tenant}.onmicrosoft.com/#{.policy}" end |
#client ⇒ Object
rubocop:disable Metrics/AbcSize
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/omniauth/strategies/infinum_azure.rb', line 12 def client # rubocop:disable Metrics/AbcSize .. = File.join(azure_oauth_url, 'authorize') ..token_url = File.join(azure_oauth_url, 'token') ..jwks_url = File.join(base_azure_url, 'discovery/v2.0/keys') ..logout_url = File.join(azure_oauth_url, 'logout').concat( "?post_logout_redirect_uri=#{File.join(full_host, path_prefix, 'logout')}" ) super end |
#other_phase ⇒ Object
34 35 36 37 38 |
# File 'lib/omniauth/strategies/infinum_azure.rb', line 34 def other_phase return call_app! unless current_path == File.join(path_prefix, name.to_s, 'logout') redirect(client.[:logout_url]) end |