docs/content/guides/developer/cryptography/zklogin-integration/developer-account.mdx
To integrate zkLogin with your app, you need an OAuth client from at least one of the available providers. You will use the Client ID and redirect URI from those providers in your zkLogin project. For example, the following TypeScript code constructs a Google login URL for testing.
const REDIRECT_URI = '<YOUR_SITE_URL>';
const params = new URLSearchParams({
// Configure client ID and redirect URI with an OpenID provider
client_id: $CLIENT_ID,
redirect_uri: $REDIRECT_URI,
response_type: 'id_token',
scope: 'openid',
// See below for details about generation of the nonce
nonce: nonce,
});
const loginURL = `https://accounts.google.com/o/oauth2/v2/auth?${params}`;
Select a tab for instruction on configuring the client ID ($CLIENT_ID in the previous example) and redirect URI ($REDIRECT_URI in the previous example) with the relevant provider.
Navigate a browser to the Google Cloud dashboard. Either sign in or register for a Google Cloud account.
Open APIs & Services > Credentials using the Google Cloud dashboard navigation.
On the Credentials page, select CREATE CREDENTIALS > OAuth client ID.
Set the Application type and Name of your application.
In the Authorized redirect URIs section, click the ADD URI button. Set the value for your redirect URI in the field. This should be the wallet or application frontend.
Click Create. If successful, Google Cloud displays the OAuth client created dialog with metadata, including your Client ID. Click OK to dismiss the dialog.
Your new OAuth client should now appear in the OAuth 2.0 Client IDs section of the Credentials page. Click the Client ID that appears next to the client to copy the value to your clipboard. Click the client name to access the redirect URI and other client data.
</TabItem> <TabItem label="Facebook" value="facebook">Register for a Facebook developer account and access the dashboard.
Select Build your app then Products then Facebook Login where you can find the client ID. Set the redirect URL. This should be the wallet or application frontend.
Sign up for Facebook developer account
Go to Settings
</TabItem> <TabItem label="Twitch" value="twitch">Register for a Twitch developer account. Access the dashboard.
Go to Register Your Application then Application where you can find the client ID. Set the redirect URL. This should be the wallet or application frontend.
Sign up for Twitch developer account
Go to Console
</TabItem> <TabItem label="Kakao" value="kakao">Add applications to Kakao
Find client ID
Set redirect URL
</TabItem> <TabItem label="Slack" value="slack">Register for a Slack developer account. Access the dashboard and go to Create New App then choose From scratch.
Create app in Slack
Find the Client ID and Client Secret under App Credentials.
Find Client ID and Client Secret
Set Redirect URL in OAuth & Permissions under Features. This should be the wallet or application frontend.
Set Redirect URL
Register for an Apple developer account. Go to the Certificates, Identifiers and Profiles section.
This is where you can create Certificates, Identifiers and Profiles
Create an App ID
com.example.app).This is how you can enable Sign In with Apple for your App ID
Create a Services ID
A Services ID identifies a specific instance of your app and is used as the OAuth client_id. You need a Services ID if you want to use Sign In with Apple for your web app.
This is where you Create a Services ID
Create a new identifier and select Services IDs as the identifier type.
client_id. Make sure to enable Sign In with Apple by checking the box next to it.Select the App ID that you created in the previous step as the Primary App ID. This will associate your Services ID with your App ID.
Enter the domain name of your app (for example, example-app.com) and the redirect URL that will receive the authorization code from Apple (for example, https://example-app.com/redirect). Note that Apple does not allow localhost or IP addresses as valid domains or redirect URLs.
Click Save and then Continue and Register until you complete this step.
You have now created an App ID and a Services ID for your app. The identifier of your Services ID is your OAuth client_id. In my example, that is com.example.client.
This is where you Set Redirect URL
Register and sign in to the Microsoft Entra admin center.
Select Applications > App registrations from the left nav.
Click the New Registration button in the top left to open the Register an application page.
Type the application name in the Name field, select the appropriate Supported account types option, and set the Redirect URI value. When satisfied, click Register.
After clicking the Register button, the admin center opens the application view. Select Authentication from the left nav of the application view.
In the Implicit grant and hybrid flows section, check the ID tokens (used for implicit and hybrid flows) box.
Click Save.
Client ID is available in the Essentials section of the application's Overview tab.
</TabItem>