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
- Set up CustomID and Service Account in DashBoard
- 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.
- Pass the idToken and sessionToken to client.
- 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!