Яuбy / Говнокод #29087 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 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

Perfección

Запостил: Shannarra_ Shannarra_, (Updated )

Комментарии (3) RSS

  • Судя по собачке, это метод объекта? А рядом такой же для другого провадйера с другими строками?
    Ответить

Добавить комментарий

Где здесь C++, guest?!

    А не использовать ли нам bbcode?


    8