Custom ID of an external server

Good morning,
I made an authentication system with a node.js server and a database. And I wanted to know how to connect an account to the Unity authentication service using a unique Id provided by my server.

Hi,

Follow this: Custom ID sign-in

Basically

  1. Set up CustomID and Service Account in DashBoard
  2. In your node.js make api calls to Token Exchange API then use token in Sign In With Custom ID API and use your provided id as externalId.
  3. Pass the idToken and sessionToken to client.
  4. In the game client use ProcessAuthenticationTokens like so
await AuthenticationService.Instance.ProcessAuthenticationTokens(idToken, sessionToken);

if username set up is in your server then you can pass the name and use

await AuthenticationService.Instance.UpdatePlayerNameAsync(username);
1 Like

I recently implemented OAuth login in Unity using the Custom ID sign-in method from the Unity Authentication package.

This approach requires a Node.js backend using Express

Here’s the full tutorial I wrote on this Unity Discussion:

You can paste the above link into ChatGPT if you want help understanding or adapting the code for your own setup.

I hope it’s helpful.

Good luck!