Beamable SDK
Classes | Public Member Functions | List of all members
Beamable.Api.Auth.AuthService Class Reference

This type defines the Client main entry point for the Auth feature. More...

Inheritance diagram for Beamable.Api.Auth.AuthService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Api.Auth.AuthService:
Collaboration graph
[legend]

Classes

class  LoginDeviceIdRequest
 

Public Member Functions

 AuthService (IBeamableRequester requester, IDeviceIdResolver deviceIdResolver=null, IAuthSettings settings=null)
 
async Promise< bool > IsThisDeviceIdAvailable ()
 Check if the current device id is available to be associated with a User. Each device id is only assignable to one User, so if one player registers the device id, that id cannot be registered by any other players. Device IDs are resolved by the IDeviceIdResolver interface. More...
 
async Promise< TokenResponseLoginDeviceId (bool mergeGamerTagToAccount=true)
 Use the device id to retrieve a TokenResponse. The resulting token response can be used to change the current User A login will only work after the device id has have registered by using the RegisterDeviceId method. More...
 
async Promise< UserRegisterDeviceId ()
 A User can associate an device id credential to their account. Once the player registers the credential, they can use the device id to retrieve a TokenResponse for the account by using the LoginDeviceId method. This method will associate the device id with the current User. The device id that will be registered is resolved by the IDeviceIdResolver interface. The device id can be removed with the RemoveDeviceId, RemoveAllDeviceIds or RemoveDeviceIds method More...
 
async Promise< string > GetDeviceId ()
 Use the current device id to retrieve a TokenResponse. The resulting token response can be used to change the current User The current device id will be resolved by the IDeviceIdResolver interface. A login will only work after the device id has been registered by using the RegisterDeviceId method. More...
 
async Promise< UserRemoveDeviceId ()
 You may want to remove an associated device id from a User. This method will remove the device that was resolved with the IDeviceIdResolver interface. More...
 
Promise< UserRemoveAllDeviceIds ()
 It is possible for a User to have multiple device IDs, if they have used multiple devices. This method will remove all device IDs. More...
 
Promise< UserRemoveDeviceIds (string[] deviceIds)
 It is possible for a User to have multiple device IDs, if they have used multiple devices. This method will remove some particular subset of the device IDs. You can check which device IDs exist on a user by checking the User.deviceIds field. More...
 
- Public Member Functions inherited from Beamable.Common.Api.Auth.AuthApi
 AuthApi (IBeamableRequester requester, IAuthSettings settings=null)
 
Promise< UserGetUser ()
 Get the main User for the current instance. More...
 
virtual Promise< UserGetUser (TokenResponse token)
 Get a specific User by passing in a TokenResponse structure. The User this method returns will be the one that has the token given. In order to get a TokenResponse, you can use the CreateUser, Login, LoginThirdParty, or LoginRefreshToken methods. More...
 
Promise< bool > IsEmailAvailable (string email)
 Check if a given email address is available to be associated with a User. Each email address is only assignable to one User, so if one player registers an email, that email cannot be registered by any other players. More...
 
Promise< bool > IsThirdPartyAvailable (AuthThirdParty thirdParty, string token)
 Check if a given AuthThirdParty's token is available to be associated with a User. Each third party issues a unique access token per player that will be stored on the Beamable servers. However, if the access token from the third party has already been associated with a User, then it cannot be associated with any other players. More...
 
Promise< TokenResponseCreateUser ()
 Create a new User on the Beamable server, and return that player's TokenResponse. To log into the new account, use the token response structure. More...
 
Promise< TokenResponseLoginRefreshToken (string refreshToken)
 Use a refresh token string to retrieve a TokenResponse. The resulting token response can be used to change the current User. More...
 
Promise< TokenResponseLogin (string username, string password, bool mergeGamerTagToAccount=true, bool customerScoped=false)
 Use email and password credentials to retrieve a TokenResponse. The resulting token response can be used to change the current User A login will only work after the email and password have been registered by using the RegisterDBCredentials method. More...
 
Promise< TokenResponseLoginThirdParty (AuthThirdParty thirdParty, string thirdPartyToken, bool includeAuthHeader=true)
 Use a token issued by a third party to retrieve a TokenResponse. The resulting token response can be used to change the current User. You should get the thirdPartyToken directly from the third party itself. A login will only work after the third party has been registered by using the RegisterThirdPartyCredentials method. More...
 
Promise< UserRegisterDBCredentials (string email, string password)
 A User can associate an email and password credential to their account. Once the player registers the credential, they can use the email and password to retrieve a TokenResponse for the account by using the Login method. This method will associate the email and password with the current User. More...
 
Promise< UserRemoveThirdPartyAssociation (AuthThirdParty thirdParty, string token)
 If a User has associated third party credentials to their account by using the RegisterThirdPartyCredentials method, you can remove the credentials with this method. In order to remove a third party association, you need to retrieve the third party's auth token for the player one last time, so that Beamable can verify that the remove operation is secure and authorized by the actual player. More...
 
Promise< UserRegisterThirdPartyCredentials (AuthThirdParty thirdParty, string accessToken)
 A User can associate a third party credential to their account. The available third party apps can be explored by looking at the AuthThirdParty enum. Once the player registers the credential, they can request a token from the third party and then submit that token to the LoginThirdParty method to retrieve a TokenResponse. This method will associate the third party token with the current User. More...
 
Promise< EmptyResponseIssueEmailUpdate (string newEmail)
 It is possible that a player may forget the email address they registered with their account when using the RegisterDBCredentials method. In that event, you can update the User.email address using this method. More...
 
Promise< EmptyResponseConfirmEmailUpdate (string code, string password)
 It is possible that a player may forget the email address they registered with their account when using the RegisterDBCredentials method. In that even, you can update the User.email address with the IssueEmailUpdate method. A unique code will be sent to the player's new email address. That code needs to be given to this method to complete the email transfer. More...
 
Promise< EmptyResponseIssuePasswordUpdate (string email)
 If the player forgets the password they registered with their email during the RegisterDBCredentials method, you can use this method to issue them a password update email. This method will send the player an email containing a unique code. That code needs to be given to the ConfirmPasswordUpdate method to complete the password update. More...
 
Promise< EmptyResponseConfirmPasswordUpdate (string code, string newPassword)
 If the player forgets the password they registered with their email during the RegisterDBCredentials method, you can use the IssuePasswordUpdate method to send the player a one time password reset code. That code needs to be given to this method, as well as a new password, to complete the password update process. More...
 
Promise< CustomerRegistrationResponseRegisterCustomer (string email, string password, string projectName, string customerName, string alias)
 This method should not be used by Developers, and will soon be marked as obsolete. More...
 
Promise< CurrentProjectResponseGetCurrentProject ()
 

Additional Inherited Members

- Static Public Attributes inherited from Beamable.Common.Api.Auth.AuthApi
const string ACCOUNT_URL = "/basic/accounts"
 
- Static Protected Attributes inherited from Beamable.Common.Api.Auth.AuthApi
const string TOKEN_URL = "/basic/auth/token"
 
- Properties inherited from Beamable.Common.Api.Auth.AuthApi
IBeamableRequester Requester [get]
 
- Properties inherited from Beamable.Common.Api.IHasBeamableRequester
IBeamableRequester Requester [get]
 Access the IBeamableRequester
 

Detailed Description

This type defines the Client main entry point for the Auth feature.

Related Links

img beamable-logo

Member Function Documentation

◆ GetDeviceId()

async Promise< string > Beamable.Api.Auth.AuthService.GetDeviceId ( )
inline

Use the current device id to retrieve a TokenResponse. The resulting token response can be used to change the current User The current device id will be resolved by the IDeviceIdResolver interface. A login will only work after the device id has been registered by using the RegisterDeviceId method.

Parameters
mergeGamerTagToAccountSince this function can only be called from a IAuthApi that already exists, there must already be some associated User account. If the mergeGamerTagToAccount is enabled, then the current player will be merged with the player associated with the given device id.
Returns
A Promise<TokenResponse> that results in the TokenResponse for the requested User's device id

Implements Beamable.Api.Auth.IAuthService.

◆ IsThisDeviceIdAvailable()

async Promise< bool > Beamable.Api.Auth.AuthService.IsThisDeviceIdAvailable ( )
inline

Check if the current device id is available to be associated with a User. Each device id is only assignable to one User, so if one player registers the device id, that id cannot be registered by any other players. Device IDs are resolved by the IDeviceIdResolver interface.

Returns
A promise that will result in true if the device id is available, false otherwise.

Implements Beamable.Api.Auth.IAuthService.

◆ LoginDeviceId()

async Promise< TokenResponse > Beamable.Api.Auth.AuthService.LoginDeviceId ( bool  mergeGamerTagToAccount = true)
inline

Use the device id to retrieve a TokenResponse. The resulting token response can be used to change the current User A login will only work after the device id has have registered by using the RegisterDeviceId method.

Parameters
mergeGamerTagToAccountSince this function can only be called from a IAuthApi that already exists, there must already be some associated User account. If the mergeGamerTagToAccount is enabled, then the current player will be merged with the player associated with the given device id
Returns
A Promise<TokenResponse> that results in the TokenResponse for the requested User's device id

Implements Beamable.Api.Auth.IAuthService.

◆ RegisterDeviceId()

async Promise< User > Beamable.Api.Auth.AuthService.RegisterDeviceId ( )
inline

A User can associate an device id credential to their account. Once the player registers the credential, they can use the device id to retrieve a TokenResponse for the account by using the LoginDeviceId method. This method will associate the device id with the current User. The device id that will be registered is resolved by the IDeviceIdResolver interface. The device id can be removed with the RemoveDeviceId, RemoveAllDeviceIds or RemoveDeviceIds method

Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.deviceIds field filled out.

Implements Beamable.Api.Auth.IAuthService.

◆ RemoveAllDeviceIds()

Promise< User > Beamable.Api.Auth.AuthService.RemoveAllDeviceIds ( )
inline

It is possible for a User to have multiple device IDs, if they have used multiple devices. This method will remove all device IDs.

Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.deviceIds field filled out.

Implements Beamable.Api.Auth.IAuthService.

◆ RemoveDeviceId()

async Promise< User > Beamable.Api.Auth.AuthService.RemoveDeviceId ( )
inline

You may want to remove an associated device id from a User. This method will remove the device that was resolved with the IDeviceIdResolver interface.

Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.deviceIds field filled out.

Implements Beamable.Api.Auth.IAuthService.

◆ RemoveDeviceIds()

Promise< User > Beamable.Api.Auth.AuthService.RemoveDeviceIds ( string[]  deviceIds)
inline

It is possible for a User to have multiple device IDs, if they have used multiple devices. This method will remove some particular subset of the device IDs. You can check which device IDs exist on a user by checking the User.deviceIds field.

Parameters
deviceIdsthe set of device IDs that you want to remove from the User
Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.deviceIds field filled out.

Implements Beamable.Api.Auth.IAuthService.


The documentation for this class was generated from the following file: