social / pragma.account / AccountService / createAccountV1 /
createAccountV1 #
suspend fun createAccountV1(session: ServiceSession, request: AccountRpc.CreateAccountV1Request): AccountRpc.CreateAccountV1Response
Creates a Pragma Account, authenticates a user against an IdentityProvider, and returns SessionTokens used for gateway authentication.
Unlike AccountService.authenticateOrCreateV2, if a Pragma account is already associated with the IdentityProvider the call will throw AccountRpc.AccountAlreadyExistsApplicationError.
Warning: This endpoint bypasses the login queue and is intended for web clients only. Usage of this endpoint in a game client is strongly discouraged.
References
Plugins
- IdentityProvider.canAuthenticate
 - IdentityProvider.validate - PragmaResultErrors returned are just thrown as PragmaExceptions
 - AccountPlugin.onAccountLogin - Called when the user successfully authenticates, including when the user is created
 - AccountPlugin.onAccountCreate - Called before an account is created for the first time
 - AccountPlugin.onAccountCreated - Called after an account is created for the first time
 
PragmaApplicationErrors
- AccountRpc.UnauthorizedApplicationError when trying to authenticate with an unexpected session type
 - AccountRpc.UnauthorizedApplicationError when failing to create authentication tokens
 - pragma.IdProviderNotFoundApplicationError when authenticating with an unknown or unconfigured IdentityProvider.
 - AccountRpc.RanOutOfDiscriminatorsApplicationError when display name has been reused too many times
 - AccountRpc.IdProviderAuthenticationDisabledApplicationError when authenticating with a disabled IdentityProvider.
 - AccountRpc.AccountAlreadyExistsApplicationError when Pragma account is already associated with the IdentityProvider
 
PragmaResultErrors
- PragmaError.Database_Error when failing to create a social identity