Skip to content

Commit

Permalink
Support on premise Active Directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Groeneveld authored and frenkel committed Jul 12, 2024
1 parent caaf208 commit 0277968
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/omniauth/strategies/azure_activedirectory_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ def client
options.custom_policy =
provider.respond_to?(:custom_policy) ? provider.custom_policy : nil

options.client_options.authorize_url = "#{options.base_azure_url}/#{options.tenant_id}/oauth2/v2.0/authorize"
oauth2 = provider.respond_to?(:adfs?) && provider.adfs? ? 'oauth2' : 'oauth2/v2.0'
options.client_options.authorize_url = "#{options.base_azure_url}/#{options.tenant_id}/#{oauth2}/authorize"
options.client_options.token_url =
if options.custom_policy
"#{options.base_azure_url}/#{options.tenant_id}/#{options.custom_policy}/oauth2/v2.0/token"
"#{options.base_azure_url}/#{options.tenant_id}/#{options.custom_policy}/#{oauth2}/token"
else
"#{options.base_azure_url}/#{options.tenant_id}/oauth2/v2.0/token"
"#{options.base_azure_url}/#{options.tenant_id}/#{oauth2}/token"
end

super
Expand Down

0 comments on commit 0277968

Please sign in to comment.