- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
# Setup the admin service from Microsoft
def setup_microsoft_admin_service
# define the empty microsoft picture url
@no_profile_picture = 'https://secure.aadcdn.microsoftonline-p.com/ests/2.1.5670.18/content/images/work_account.png'
# Application id and secret from microsoft
client_id = ENV['AZURE_CLIENT_ID']
# client_secret = 'z8uGboGliWfBqa8/s8K4KbDH96l1F0+PuFwX+AOGJTQ='
client_secret = ENV['AZURE_CLIENT_SECRET']
# Should also be listed in microsoft app
tenant = Current.organization['microsoft_azure_domain_hint']
# Create credentials using Active Directory Azure Library
client_cred = ADAL::ClientCredential.new(client_id, client_secret)
context = ADAL::AuthenticationContext.new(ADAL::Authority::WORLD_WIDE_AUTHORITY, tenant)
# Return the acquired tokens from the graph site
context.acquire_token_for_client('https://graph.microsoft.com', client_cred)
end
Комментарии (2) RSS
Добавить комментарий