Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Sebelum menambahkan login Sekali Ketuk ke aplikasi, siapkan API Google dan project
Android.
Menyiapkan project konsol API Google
Buka project Anda di API Console,
atau buat project jika Anda belum memilikinya.
Di halaman layar izin OAuth, pastikan semua informasi
lengkap dan akurat. Secara khusus, pastikan Anda telah menentukan URL
kebijakan privasi dan persyaratan layanan aplikasi Anda.
Di halaman Kredensial, buat client ID Android untuk aplikasi Anda jika Anda
belum memilikinya. Anda harus menentukan nama paket dan
tanda tangan SHA-1 aplikasi.
Di halaman Kredensial, buat client ID aplikasi web jika Anda belum memilikinya. Anda dapat mengosongkan kolom Asal JavaScript yang Diotorisasi dan URI Pengalihan yang Diotorisasi. Client ID ini mewakili
server backend autentikasi Anda. (Anda akan menggunakan client ID ini saat memanggil
Google API dari server, tetapi Anda memerlukannya meskipun tidak.)
Jika Anda memiliki situs yang menggunakan backend login aplikasi,
buat dan publikasikan file Digital Asset Links
sehingga pengguna yang login di satu platform dapat dengan mudah login di platform lainnya.
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-07-27 UTC."],[],[],null,["# Get started with One Tap sign-in and sign-up\n\n| **Caution:** One Tap for Android is deprecated. To ensure the continued security and usability of your app, [migrate to\n| Credential Manager](/identity/sign-in/credential-manager). Credential Manager supports passkey, password, and federated identity authentication (such as Sign-in with Google), stronger security, and a more consistent user experience.\n\nBefore you add One Tap sign-in to your app, set up your Google APIs and Android\nprojects.\n\nSet up your Google APIs console project\n---------------------------------------\n\n1. Open your project in the [API Console](https://console.cloud.google.com/), or create a project if you don't already have one.\n2. On the OAuth consent screen page, make sure all of the information is complete and accurate. In particular, make sure you have specified the URLs of your app's privacy policy and terms of service.\n3. On the Credentials page, create an Android client ID for your app if you don't already have one. You will need to specify your app's package name and SHA-1 signature.\n 1. Go to the [Credentials page](https://console.cloud.google.com/apis/credentials).\n 2. Click **Create credentials \\\u003e OAuth client ID**.\n 3. Select the **Android** application type.\n4. On the Credentials page, create a web application client ID if you don't already have one. You can leave the Authorized JavaScript Origins and Authorized redirect URIs fields blank. This client ID represents your authentication backend server. (You would use this client ID when calling Google APIs from your server, but you need it even if you don't.)\n 1. Go to the [Credentials page](https://console.cloud.google.com/apis/credentials).\n 2. Click **Create credentials \\\u003e OAuth client ID**.\n 3. Select the **Web application** application type.\n\nInclude dependencies in your Android project\n--------------------------------------------\n\n1. In your project-level `build.gradle` file, make sure to include Google's Maven repository (`google()`) in both your `buildscript` and `allprojects` sections.\n2. Add the dependencies for [Google Play services](https://developers.google.com/android)' authentication libraries\n to your module (app-level) build file (usually `app/build.gradle`):\n\n apply plugin: 'com.android.application'\n\n dependencies {\n // ...\n\n implementation 'com.google.android.gms:play-services-auth:21.3.0'\n }\n\nOptional: Associate your app with your site\n-------------------------------------------\n\nIf you have a web site that shares your app's sign-in backend,\n[create and publish a digital asset links file](https://developers.google.com/identity/smartlock-passwords/android/associate-apps-and-sites)\nso that users who sign in on one platform can easily sign in on the other.\n\nNext steps\n----------\n\n[Add One Tap sign-in flows to your app](/identity/legacy/one-tap/legacy-get-saved-credentials)."]]