feat: Support Azure single-tenant application using the Graph API (#6728) (#6878)

This commit is contained in:
Tejaswini Chile
2023-06-28 08:13:08 +05:30
committed by GitHub
parent 4a770fdea7
commit d05c953eef
14 changed files with 451 additions and 13 deletions

View File

@@ -5,8 +5,8 @@ module MicrosoftConcern
::OAuth2::Client.new(ENV.fetch('AZURE_APP_ID', nil), ENV.fetch('AZURE_APP_SECRET', nil),
{
site: 'https://login.microsoftonline.com',
authorize_url: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
token_url: 'https://login.microsoftonline.com/common/oauth2/v2.0/token'
authorize_url: "https://login.microsoftonline.com/#{azure_tenant_id}/oauth2/v2.0/authorize",
token_url: "https://login.microsoftonline.com/#{azure_tenant_id}/oauth2/v2.0/token"
})
end
@@ -19,4 +19,8 @@ module MicrosoftConcern
def base_url
ENV.fetch('FRONTEND_URL', 'http://localhost:3000')
end
def azure_tenant_id
MicrosoftGraphAuth.azure_tenant_id
end
end