We use the term Argus Auth and Argus ID interchangeably.
Prerequisites
Before you begin, make sure you have completed the Quickstart guide.Sign in with Argus ID
Checking authentication state
Useworld.auth.getUser()
to get the current user. If this is your first time using Argus Auth,
this will return null
. You’d normally do this in the main menu of your game.
Main Menu
getUser()
method returns either:
- An
AuthUser
object if the user is authenticated null
if no user is currently signed in
What's in the AuthUser object?
What's in the AuthUser object?
The
AuthUser
object contains user information from Argus Auth:Signing in
The following example shows how to sign in if no user is found. This is a simple example, on your game you might want to show a button to sign in.Main Menu
The
signInWithArgusID()
method automatically handles the auth flow, including opening the
authentication popup and managing token. The token is stored in the browser’s local storage,
therefore is persistent across reloads.Handling User Logout
Use thelogout()
method to sign out the current user:
Logout