1. Ruby / Говнокод #29087

    0

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    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_, 10 Февраля 2025

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

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

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