Beamable SDK
Public Member Functions | List of all members
Beamable.Common.Api.Auth.IAuthApi Interface Reference
Inheritance diagram for Beamable.Common.Api.Auth.IAuthApi:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Common.Api.Auth.IAuthApi:
Collaboration graph
[legend]

Public Member Functions

Promise< UserGetUser ()
 Get the main User for the current instance. More...
 
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< 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< 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...
 

Additional Inherited Members

- Properties inherited from Beamable.Common.Api.IHasBeamableRequester
IBeamableRequester Requester [get]
 Access the IBeamableRequester
 

Member Function Documentation

◆ ConfirmEmailUpdate()

Promise< EmptyResponse > Beamable.Common.Api.Auth.IAuthApi.ConfirmEmailUpdate ( 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.

Parameters
codeThe code that was sent to the player's new email
passwordThe player's password, to confirm the email transfer
Returns
An empty Promise representing the network request's completion.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ ConfirmPasswordUpdate()

Promise< EmptyResponse > Beamable.Common.Api.Auth.IAuthApi.ConfirmPasswordUpdate ( 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.

Parameters
codeThe code that was sent to the player's email address
newPasswordA new password that the player can use to sign in. This password will replace the old password.
Returns
An empty Promise representing the network request's completion.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ CreateUser()

Promise< TokenResponse > Beamable.Common.Api.Auth.IAuthApi.CreateUser ( )

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.

Returns
A Promise<TokenResponse> that results in the TokenResponse for the new User

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ GetUser() [1/2]

Promise< User > Beamable.Common.Api.Auth.IAuthApi.GetUser ( )

Get the main User for the current instance.

Returns
A Promise<User> representing when the User has been retrieved.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ GetUser() [2/2]

Promise< User > Beamable.Common.Api.Auth.IAuthApi.GetUser ( 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.

Parameters
tokenThe TokenResponse structure containing token information for the User you want to get.
Returns
A Promise<User> representing when the User has been retrieved.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ IsEmailAvailable()

Promise< bool > Beamable.Common.Api.Auth.IAuthApi.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.

Parameters
emailThe email address to check
Returns
A promise that will result in true if the address is available, false otherwise.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ IssueEmailUpdate()

Promise< EmptyResponse > Beamable.Common.Api.Auth.IAuthApi.IssueEmailUpdate ( 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.

Once this method executes, the player should receive an email to the given address that contains a unique code. That code needs to be given to the ConfirmEmailUpdate function to complete the email transfer.

Parameters
newEmailThe new email address
Returns
An empty Promise representing the network request's completion.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ IssuePasswordUpdate()

Promise< EmptyResponse > Beamable.Common.Api.Auth.IAuthApi.IssuePasswordUpdate ( 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.

Parameters
emailThe email address to send the code to. This must always be the same address registered as the User's User.email
Returns
An empty Promise representing the network request's completion.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ IsThirdPartyAvailable()

Promise< bool > Beamable.Common.Api.Auth.IAuthApi.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.

Parameters
thirdPartythe AuthThirdParty that issued the token
tokenthe token that was issued by the third party. You should get this directly from the third party itself.
Returns
A promise that will result in true if the token is available, false otherwise.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ Login()

Promise< TokenResponse > Beamable.Common.Api.Auth.IAuthApi.Login ( 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.

Parameters
usernameThe email address of the User
passwordThe password the player registered when they associated their email address
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 email and password.
customerScopedThe email and password login can return a TokenResponse that works for a specific CID / PID combo, or for an entire CID, across all PIDs. When customerScoped is enabled, the resulting token will be eligible for the entire CID, regardless of PID. However, this type of token will only work for User's who are at least testers, developers, or admins.
Returns
A Promise<TokenResponse> that results in the TokenResponse for the requested User's email/password

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ LoginRefreshToken()

Promise< TokenResponse > Beamable.Common.Api.Auth.IAuthApi.LoginRefreshToken ( string  refreshToken)

Use a refresh token string to retrieve a TokenResponse. The resulting token response can be used to change the current User.

Parameters
refreshTokenThe refresh token of a User. This value can be found in the IAccessToken.RefreshToken field.
Returns
A Promise<TokenResponse> that results in the TokenResponse for the requested User's refresh token

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ LoginThirdParty()

Promise< TokenResponse > Beamable.Common.Api.Auth.IAuthApi.LoginThirdParty ( 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.

Parameters
thirdPartyThe AuthThirdParty that issued the thirdPartyToken
thirdPartyTokenThe token that you received from the given AuthThirdParty
includeAuthHeaderSince this function can only be called from a IAuthApi that already exists, there must already be some associated User account. If the includeAuthHeader is enabled, then the current player will be merged with the player associated with the given third party credential.
Returns

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ RegisterCustomer()

Promise< CustomerRegistrationResponse > Beamable.Common.Api.Auth.IAuthApi.RegisterCustomer ( 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.

Parameters
email
password
projectName
customerName
alias
Returns

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ RegisterDBCredentials()

Promise< User > Beamable.Common.Api.Auth.IAuthApi.RegisterDBCredentials ( 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.

Parameters
emailAn email address to associate with the player. Email addresses must be unique to each player. You can use the IsEmailAvailable method to check if the given email is available before attempting the RegisterDBCredentials.
passwordA password for the player to use later to recover their account.
Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.email field filled out.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ RegisterThirdPartyCredentials()

Promise< User > Beamable.Common.Api.Auth.IAuthApi.RegisterThirdPartyCredentials ( 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.

Parameters
thirdPartyThe AuthThirdParty that issued the accessToken
accessTokenThe token issued by the thirdParty
Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.thirdPartyAppAssociations field updated.

Implemented in Beamable.Common.Api.Auth.AuthApi.

◆ RemoveThirdPartyAssociation()

Promise< User > Beamable.Common.Api.Auth.IAuthApi.RemoveThirdPartyAssociation ( 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.

Parameters
thirdPartyThe AuthThirdParty that issues the token
tokenThe token issued by the thirdParty
Returns
A Promise<User> that will have the updated User data for the current user. The resulting User object will have the User.thirdPartyAppAssociations field updated.

Implemented in Beamable.Common.Api.Auth.AuthApi.


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