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 PragmaError.AccountService_AlreadyExists.
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
PragmaResultErrors
- PragmaError.AccountService_AlreadyExists when Pragma account is already associated with the IdentityProvider
- PragmaError.AccountService_IdProviderMissing when authenticating with an unknown or unconfigured IdentityProvider.
- PragmaError.AccountService_IdProviderAuthenticationDisabled when authenticating with a disabled IdentityProvider.
- PragmaError.AccountService_Error when social id cannot be created
- PragmaError.Database_Error when failing to create a social identity
- PragmaError.AccountService_Unauthorized when trying to authenticate with an unexpected session type
- PragmaError.AccountService_Error when failing to create authentication tokens
- PragmaError.AccountService_RanOutOfDiscriminators when display name has been reused too many times