mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
22 lines
752 B
Ruby
22 lines
752 B
Ruby
module MicrosoftConcern
|
|
extend ActiveSupport::Concern
|
|
|
|
def microsoft_client
|
|
app_id = GlobalConfigService.load('AZURE_APP_ID', nil)
|
|
app_secret = GlobalConfigService.load('AZURE_APP_SECRET', nil)
|
|
|
|
::OAuth2::Client.new(app_id, app_secret,
|
|
{
|
|
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'
|
|
})
|
|
end
|
|
|
|
private
|
|
|
|
def scope
|
|
'offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/SMTP.Send openid profile email'
|
|
end
|
|
end
|