Sign In with ID tokens
Learn about ID tokens
Overview
ID tokens are tokens provided by identity providers that contain authenticated user information and are specifically designed for authentication purposes, unlike access tokens which are used for authorization. ID tokens include claims about the user’s identity, such as user ID, name, and email, along with metadata like token expiration time and intended audience.
ID tokens serve as a secure proof that a user has already been authenticated by a trusted identity provider. When someone logs in through their device’s built-in authentication (like Sign in with Apple on iOS/macOS or Google Sign-in on Android), the system generates an ID token. This token can then be passed to your authentication service, confirming the user’s identity without requiring them to log in again. This streamlined approach works with any OpenID Connect (OIDC) provider, including popular services like Google One Tap sign-in, making the authentication process both secure and user-friendly.
Usage
To use ID tokens, you need to configure supported identity providers (currently apple and google) and make sure the audience
is set correctly.
Sign in
Once everything is configured you can use an ID token to authenticate users with just a single call:
Link Provider to existing user
Similarly to the Social Connect feature, you can link an identity provider to an existing user:
Examples
Below you can find some examples on how to extract an ID Token from various identity providers to be used with the Auth service. Keep in mind these are just some examples, use cases and sources are not limited to the examples below.
React Native
Apple
For an example on how to authenticate using “Sign in with Apple” on iOS using React Native you can refer to our sample component.
For an example on how to authenticate using “Sign in with Google” on Android using React Native you can refer to our sample component.