Before you add One Tap sign-in to your app, set up your Google APIs and Android projects.
Set up your Google APIs console project
- Open your project in the API Console, or create a project if you don't already have one.
- 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.
- 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.
- Go to the Credentials page.
- Click Create credentials > OAuth client ID.
- Select the Android application type.
- 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.)
- Go to the Credentials page.
- Click Create credentials > OAuth client ID.
- Select the Web application application type.
Include dependencies in your Android project
- In your project-level
build.gradle
file, make sure to include Google's Maven repository (google()
) in both yourbuildscript
andallprojects
sections. Add the dependencies for Google Play services' authentication libraries to your module (app-level) build file (usually
app/build.gradle
):apply plugin: 'com.android.application' dependencies { // ... implementation 'com.google.android.gms:play-services-auth:21.2.0' }
Optional: Associate your app with your site
If you have a web site that shares your app's sign-in backend, create and publish a digital asset links file so that users who sign in on one platform can easily sign in on the other.