Interface ITrustedClient
The Trusted Client provides management for game apis using trusted authorization. Authorization relies on Service Account authentication.
Namespace: Unity.Services.Apis
Assembly: Unity.Services.Apis.dll
Syntax
public interface ITrustedClient
Properties
AccessToken
The access token applied to apis.
Declaration
string AccessToken { get; }
Property Value
Type | Description |
---|---|
string |
CloudCode
CloudCode Api
Declaration
ICloudCodeApi CloudCode { get; }
Property Value
Type | Description |
---|---|
ICloud |
CloudSaveData
CloudSave Player Data Api
Declaration
ICloudSaveDataApi CloudSaveData { get; }
Property Value
Type | Description |
---|---|
ICloud |
CloudSaveFiles
CloudSave Files Api
Declaration
ICloudSaveFilesApi CloudSaveFiles { get; }
Property Value
Type | Description |
---|---|
ICloud |
EconomyConfiguration
EconomyConfiguration Api
Declaration
IEconomyConfigurationApi EconomyConfiguration { get; }
Property Value
Type | Description |
---|---|
IEconomy |
EconomyCurrencies
EconomyCurrencies Api
Declaration
IEconomyCurrenciesApi EconomyCurrencies { get; }
Property Value
Type | Description |
---|---|
IEconomy |
EconomyInventory
EconomyInventory Api
Declaration
IEconomyInventoryApi EconomyInventory { get; }
Property Value
Type | Description |
---|---|
IEconomy |
EconomyPurchases
EconomyPurchases Api
Declaration
IEconomyPurchasesApi EconomyPurchases { get; }
Property Value
Type | Description |
---|---|
IEconomy |
Leaderboards
Leaderboards Api
Declaration
ILeaderboardsApi Leaderboards { get; }
Property Value
Type | Description |
---|---|
ILeaderboards |
Lobby
Lobby Api
Declaration
ILobbyApi Lobby { get; }
Property Value
Type | Description |
---|---|
ILobby |
MultiplayAllocations
Multiplay Allocations Api
Declaration
IMultiplayAllocationsApi MultiplayAllocations { get; }
Property Value
Type | Description |
---|---|
IMultiplay |
MultiplayFleets
Multiplay Fleets Api
Declaration
IMultiplayFleetsApi MultiplayFleets { get; }
Property Value
Type | Description |
---|---|
IMultiplay |
PlayerAuthentication
PlayerAuthentication Api
Declaration
IPlayerAuthenticationApi PlayerAuthentication { get; }
Property Value
Type | Description |
---|---|
IPlayer |
PlayerNames
Player Names Api
Declaration
IPlayerNamesApi PlayerNames { get; }
Property Value
Type | Description |
---|---|
IPlayer |
Methods
ClearCredentials()
Clears the credentials from the configuration of all apis
Declaration
void ClearCredentials()
SetAccessToken(string)
Apply the trusted access token to the apis
Declaration
void SetAccessToken(string accessToken)
Parameters
Type | Name | Description |
---|---|---|
string | accessToken | The trusted access token |
SetServiceAccount(string, string)
Set the service account that the apis will use.
Declaration
void SetServiceAccount(string apiKey, string apiSecret)
Parameters
Type | Name | Description |
---|---|---|
string | apiKey | The service account key |
string | apiSecret | The service account secret |
SignInWithServiceAccount(string, string, List<string>, CancellationToken)
Exchange service account credentials for an access token to use with game apis.
- IMPORTANT * Always protect your service account credentials. Make sure service account information is never used in a game client.
Declaration
ApiOperation<ExchangeResponse> SignInWithServiceAccount(string projectId, string environmentId, List<string> scopes = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The cloud project id |
string | environmentId | The environment id |
List<string> | scopes | The permission scopes |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
Events
AccessTokenChanged
Event raised when the access token changed.
Declaration
event Action AccessTokenChanged
Event Type
Type | Description |
---|---|
Action |