OAuth Hizmet Hesabı Akışı
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu kılavuzda, hizmet hesaplarını kullanarak kendi kimlik bilgilerinizle API erişimi için OAuth2'yi nasıl ayarlayacağınız açıklanmaktadır.
OAuth2 kimlik bilgilerinizi iptal etmediğiniz veya silmediğiniz sürece bu adımların yalnızca bir kez yapılması gerekir.
OAuth2 kimlik bilgileri oluşturma
Bağlantılı talimatları uygulayarak hizmet hesabı kimliği ve *.JSON dosyası oluşturun, ardından bu sayfaya geri dönün.
İstemci kitaplığını ayarlama
Yapılandırmanızda özel anahtar JSON yolunu ayarlayın. Kimliğe bürünerek kimlik doğrulaması yapıyorsanız kimliğine bürünülecek kullanıcıyı da ayarlayın.
ads.properties
dosyası kullanıyorsanız aşağıdakileri ekleyin:
api.googleads.serviceAccountSecretsPath=PRIVATE_KEY_FILE_PATH
# Only add this key if you are using impersonation.
api.googleads.serviceAccountUser=USER_TO_IMPERSONATE
Ek ayrıntılar için yapılandırma kılavuzuna bakın.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-27 UTC.
[null,null,["Son güncelleme tarihi: 2025-08-27 UTC."],[[["\u003cp\u003eThis guide explains how to set up OAuth2 for API access using service accounts with your own credentials.\u003c/p\u003e\n"],["\u003cp\u003eThe setup process involves generating a service account ID and a JSON file, and then configuring your client library with the necessary credentials.\u003c/p\u003e\n"],["\u003cp\u003eThis setup needs to be done only once and requires a Google Workspace domain with domain-wide delegation access granted to the service account.\u003c/p\u003e\n"]]],[],null,["# OAuth Service Account Flow\n\nThis guide will walk you through how to setup OAuth2 for API access using your\nown credentials using [service accounts](/google-ads/api/docs/oauth/service-accounts).\nThese steps only need to be done once, unless you revoke or delete your OAuth2\ncredentials.\n\nCreate OAuth2 credentials\n-------------------------\n\n[Generate a **service account ID and a \\*.JSON\nfile**](/google-ads/api/docs/oauth/service-accounts#service_account_access_setup) by\nfollowing the linked instructions, then come back to this page.\n\nSet up client library\n---------------------\n\nSet the private key JSON path in your configuration. If you're [authenticating\nusing impersonation](/google-ads/api/docs/oauth/service-accounts#impersonation), also set the\nuser to impersonate.\n\nIf you're using an `ads.properties` file, add the following: \n\n api.googleads.serviceAccountSecretsPath=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-s\"\u003ePRIVATE_KEY_FILE_PATH\u003c/span\u003e\u003c/var\u003e\n # Only add this key if you are using impersonation.\n api.googleads.serviceAccountUser=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-s\"\u003eUSER_TO_IMPERSONATE\u003c/span\u003e\u003c/var\u003e\n\nSee the [configuration guide](/google-ads/api/docs/client-libs/java/config-file) for\nadditional details."]]