Skip to main content

auth

Namespace for authentication-related functions: Toss login flow, Toss Cert (electronic signature), anonymous key retrieval, and Toss login integration checks. All functions return a Promise.

Methods

MethodReturn typePurpose
appLoginPromise<{ authorizationCode: string; referrer: 'DEFAULT' | 'SANDBOX' }>Start the Toss login flow and receive an authorization code.
appsInTossSignTossCertPromise<void>Sign with the Toss Cert certificate. Must be called after appLogin.
getAnonymousKeyPromise<{ type: 'HASH'; hash: string } | 'ERROR' | undefined>Retrieve an anonymous identifier without requiring login.
getIsTossLoginIntegratedServicePromise<boolean | undefined>Check whether the user has integrated Toss login.
getUserKeyForGamePromise<{ key: string } | 'INVALID_CATEGORY' | 'ERROR' | undefined>Deprecated. Game-session anonymous key. Use getAnonymousKey instead.

Permission

No PermissionName is bound to any function in the auth namespace — none expose .getPermission() / .openPermissionDialog() helpers. The appLogin call automatically surfaces the user consent screen. For how other namespaces handle permissions, see Guides — Permissions pattern.

UX guidance

  • Call appLogin only in response to an explicit user action. A login button tap, the start of a payment flow, etc. Auto-calling on page load is not recommended.
  • Forward the authorization code to your server immediately. The authorizationCode returned by appLogin is a short-lived token — do not store it on the client.
  • Complete appLogin before calling appsInTossSignTossCert. Invoking the cert-signing call without an active login session may fail.
  • Handle all three getAnonymousKey outcomes. undefined means the app version is too old; 'ERROR' means an unknown error occurred; only the success object contains a usable hash.
  • getIsTossLoginIntegratedService is for migration scenarios. Use it when migrating existing Toss login users to a game identifier or another identity system.

Try it live

Methods are available on the Auth page in sdk-example.

Open in sdk-example

External references