Authentication
The Authentication API provides secure methods for authenticating users with the Gamerbase API. It supports multiple authenticate protocols including OAuth 2.0, ZKLogin, SIWE and Password.
Last updated
The Authentication API provides secure methods for authenticating users with the Gamerbase API. It supports multiple authenticate protocols including OAuth 2.0, ZKLogin, SIWE and Password.
Last updated
Session tokens have a TTL of 10 minutes. When a session token has expired the refresh-session
endpoint must be called with the refresh token to generate a new session token. Refresh tokens have a TTL of 30 days.
POST
/v1/user/auth/refresh-session
The Refresh Session API allows you to obtain a new session token from a refresh token.
refreshToken*
String
Required
The following authentication methods leverage trusted OAuth providers. The credential
or token
property are required depending on the auth method for the required field is a credential string. For all other OAuth authentication methods the token
property is required. The token property is an encrypted JWT containing user OAuth data and a _nonce
property. The JWT must be encrypted using a shared secret that is configured in the tenant of the consuming community.
POST
/v1/user/auth/google/login
The Google Login API allows users to sign in using their Google account.
credential
String
Required
referrerHandle
String
Optional
POST
/v1/user/auth/discord/login
The Discord Login API allows users to sign in using Discord credentials.
token
String
Required
accessToken
String
Optional
referrerHandle
String
Optional
POST
/v1/user/auth/twitter/login
The Twitter Login API allows users to sign in using Twitter credentials.
token*
String
Required
accessToken*
String
Optional
referrerHandle*
String
Optional
Logging in with any ZKLogin endpoint automatically creates a SUI wallet for that user. The wallet is linked to the OAuth provider they logged in with. When utilising ZKLogin as the primary authentication mechanism it is required to enforce "primary account login". This ensure that a user always logs in with the account they used to register, this maintains consistency in the wallet address that is created for the user.
POST
/v1/user/auth/google/zklogin
The Google ZKLogin API allows users to perform ZKLogin using Google credentials.
token*
String
Required
accessToken*
String
Optional
referrerHandle*
String
Optional
POST
/v1/user/auth/twitch/zklogin
The Twitch ZKLogin API allows users to perform ZKLogin using Twitch credentials.
token*
String
Required
accessToken*
String
Optional
referrerHandle*
String
Optional
POST
/v1/user/auth/siwe/login
The SIWE Login API allows users to sign in using SIWE credentials (Sign In WIth Ethereum)
message*
String
Required
signature*
String
Required
referrerHandle*
String
Optional
POST
/v1/user/register/password
The Password Register API allows users to signup using their password credentials.
username
String
Required
password
String
Required
POST
/v1/user/auth/password/login
The Password Login API allows users to sign in using their password credentials.
username
String
Required
password
String
Required
For more information on the implementation of ZKLogin please reference the .