Beamable SDK
Public Member Functions | Properties | List of all members
Beamable.Api.AccessToken Class Reference

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

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

Public Member Functions

 AccessToken (AccessTokenStorage storage, string cid, string pid, string token, string refreshToken, long expiresAt)
 
 AccessToken (AccessTokenStorage storage, string cid, string pid, string token, string refreshToken, string expiresAtISO)
 
Promise< UnitSave ()
 Saving an AccessToken commits the full token structure to PlayerPrefs. Only one token can be saved per player code / cid / pid combo. More...
 
Promise< UnitSaveAsCustomerScoped ()
 Saving an AccessToken as a customer scoped token will commit the full token structure to PlayerPrefs, but do so without scoping it with the token's AccessToken.Pid. Only one token can be saved per player code / cid combo. More...
 
Promise< UnitDelete ()
 Deleting an AccessToken will remove the full token structure from PlayerPrefs. More...
 
Promise< UnitDeleteAsCustomerScoped ()
 Deleting an AccessToken will remove the full token structure from PlayerPrefs. More...
 
void CorruptAccessToken ()
  DANGEROUS This method can be used to simulate what happens if the internal AccessToken.Token is corrupted. You may want to do this during testing to check if the game can recover from a corrupted token.
 
void ExpireAccessToken ()
  DANGEROUS This method can be used to simulate what happens if the internal AccessToken.Token has expired. You may want to do this during testing to check if the game can recover from an expired token.
 

Properties

string Token [get]
 
string RefreshToken [get]
 
DateTime ExpiresAt [getset]
 
string Cid [get]
 
string Pid [get]
 
bool IsExpired [get]
 Check if the Token is expired, or will expire within the play session.
 
- Properties inherited from Beamable.Common.Api.IAccessToken
string Token [get]
 The token is a temporary access token that authenticates a player. This string should not be stored on its own, because eventually it will expire and cease to function. When the token expires, a new token will be issued by using the RefreshToken
 
string RefreshToken [get]
 When the Token expires, the refresh token can be used to issue a new token string by using the Auth.IAuthApi.LoginRefreshToken method
 
DateTime ExpiresAt [get]
 Indicates when the Token will expire.
 
string Cid [get]
 The customer organization that this token is valid for.
 
string Pid [get]
 The realm id that this token is valid for. If this token is a customer scoped token, then the value of the Pid will be null
 

Detailed Description

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

Related Links

img beamable-logo

Member Function Documentation

◆ Delete()

Promise< Unit > Beamable.Api.AccessToken.Delete ( )
inline

Deleting an AccessToken will remove the full token structure from PlayerPrefs.

Returns
A promise indicating when the delete operation will complete.

◆ DeleteAsCustomerScoped()

Promise< Unit > Beamable.Api.AccessToken.DeleteAsCustomerScoped ( )
inline

Deleting an AccessToken will remove the full token structure from PlayerPrefs.

Returns
A promise indicating when the delete operation will complete.

◆ Save()

Promise< Unit > Beamable.Api.AccessToken.Save ( )
inline

Saving an AccessToken commits the full token structure to PlayerPrefs. Only one token can be saved per player code / cid / pid combo.

Returns
A promise indicating when the write operation will complete.

◆ SaveAsCustomerScoped()

Promise< Unit > Beamable.Api.AccessToken.SaveAsCustomerScoped ( )
inline

Saving an AccessToken as a customer scoped token will commit the full token structure to PlayerPrefs, but do so without scoping it with the token's AccessToken.Pid. Only one token can be saved per player code / cid combo.

Returns
A promise indicating when the write operation will complete.

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