### IPlayerAccountService.StartSignInAsync(bool) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerAccounts.IPlayerAccountService.html Starts the sign in flow by launching the system browser to sign in the current player or sign them up. ```APIDOC ## Method: StartSignInAsync(bool) ### Description Starts the sign in flow by launching the system browser to sign in the current player or sign them up. ### Declaration ```csharp Task StartSignInAsync(bool isSigningUp = false) ``` ### Parameters | Type | Name | Description | |------|------|-------------| | bool | isSigningUp | If set to `true`, the method initiates the sign-up flow. By default, it initiates the sign-in flow. | ### Returns | Type | Description | |------|-------------| | Task | A task representing the asynchronous operation. | ### Remarks To be notified of the sign-in outcome, including the retrieval of tokens, the developer must subscribe to the SignedIn event. ``` -------------------------------- ### GetOpenIdConnectIdProviders() Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerInfo.html Get all OpenID Connect id providers linked to the player. ```APIDOC ## GetOpenIdConnectIdProviders() ### Description Get all OpenID Connect id providers linked to the player. ### Declaration ```csharp public List GetOpenIdConnectIdProviders() ``` ### Returns - List - A list of all OpenID Connect id providers. ``` -------------------------------- ### Waiting Event Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Editor.IdProviderCustomSettingsElement.html Event triggered when the IdProviderCustomSettingsElement starts or finishes waiting for a task. The first parameter of the callback is the sender. The second parameter is true if it starts waiting, and false if it finishes waiting. ```APIDOC ## Waiting Event ### Description Event triggered when the IdProviderCustomSettingsElement starts or finishes waiting for a task. The first parameter of the callback is the sender. The second parameter is true if it starts waiting, and false if it finishes waiting. ### Declaration ```csharp public abstract event Action Waiting ``` ### Event Type - **Type**: `Action` - **Description**: The callback receives the sender and a boolean indicating waiting state. ``` -------------------------------- ### SignUpWithUsernamePasswordAsync(string, string) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign up using Username and Password credentials. ```APIDOC ## SignUpWithUsernamePasswordAsync(string, string) ### Description Sign up using Username and Password credentials. ### Method SignUpWithUsernamePasswordAsync ### Parameters - **username** (string) - Required - Username of the player. Note that it must be unique per project and contains 3-20 characters of alphanumeric and/or these special characters [. - @ _]. - **password** (string) - Required - Password of the player. Note that it must contain 8-30 characters with at least 1 upper case, 1 lower case, 1 number, and 1 special character. ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### IPlayerAccountService.IdToken Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerAccounts.IPlayerAccountService.html Gets the ID token that was obtained during sign-in. ```APIDOC ## Property: IdToken ### Description Gets the ID token that was obtained during sign-in. ### Declaration ```csharp string IdToken { get; } ``` ### Property Value | Type | Description | |------|-------------| | string | The ID token. | ``` -------------------------------- ### IPlayerAccountService.AccountPortalUrl Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerAccounts.IPlayerAccountService.html Get the player account portal URL. ```APIDOC ## Property: AccountPortalUrl ### Description Get the player account portal URL. ### Declaration ```csharp string AccountPortalUrl { get; } ``` ### Property Value | Type | Description | |------|-------------| | string | The player account portal URL. | ``` -------------------------------- ### SignInWithSteamAsync(string sessionTicket, string identity, string appId, SignInOptions options = null) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using Steam's session ticket. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithSteamAsync(string sessionTicket, string identity, string appId, SignInOptions options = null) ### Description Sign in using Steam's session ticket. If no options are used, this will create an account if none exist. ### Method SignInWithSteamAsync ### Parameters - **sessionTicket** (string) - Required - Steam's session ticket - **identity** (string) - Required - The identity of the calling service - **appId** (string) - Required - App Id that was used to generate the ticket. Only required for additional app ids (e.g.: PlayTest, Demo, etc) - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### IPlayerAccountService.AccessToken Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerAccounts.IPlayerAccountService.html Gets the access token that was obtained during sign-in. ```APIDOC ## Property: AccessToken ### Description Gets the access token that was obtained during sign-in. ### Declaration ```csharp string AccessToken { get; } ``` ### Property Value | Type | Description | |------|-------------| | string | The access token. | ``` -------------------------------- ### SignInWithAppleAsync(string, SignInOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using Apple's ID token. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithAppleAsync(string, SignInOptions) ### Description Sign in using Apple's ID token. If no options are used, this will create an account if none exist. ### Method SignInWithAppleAsync ### Declaration ``` Task SignInWithAppleAsync(string idToken, SignInOptions options = null) ``` ### Parameters - **idToken** (string) - Required - Apple's ID token - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### SignInWithGoogleAsync(string, SignInOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using Google's ID token. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithGoogleAsync(string, SignInOptions) ### Description Sign in using Google's ID token. If no options are used, this will create an account if none exist. ### Declaration ```csharp Task SignInWithGoogleAsync(string idToken, SignInOptions options = null) ``` ### Parameters - **idToken** (string) - Required - Google's ID token - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### IPlayerAccountService.IdTokenClaims Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerAccounts.IPlayerAccountService.html Gets the claims from the ID token that was obtained during sign-in. ```APIDOC ## Property: IdTokenClaims ### Description Gets the claims from the ID token that was obtained during sign-in. ### Declaration ```csharp IdToken IdTokenClaims { get; } ``` ### Property Value | Type | Description | |------|-------------| | IdToken | The claims from the ID token. | ``` -------------------------------- ### SignInWithSteamAsync(string, string, SignInOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Signs in using Steam's session ticket with an identity parameter. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithSteamAsync(string, string, SignInOptions) ### Description Sign in using Steam's session ticket. If no options are used, this will create an account if none exist. ### Method SignInWithSteamAsync ### Parameters - **sessionTicket** (string) - Required - Steam's session ticket - **identity** (string) - Required - The identity of the calling service - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - Thrown when the task cannot complete successfully due to Authentication specific errors. Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - Thrown when the task cannot complete successfully. Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. Throws with `ErrorCode` TransportError if the API call failed due to network error. Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. ``` -------------------------------- ### GatewayToken Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Editor.IdProviderCustomSettingsElement.html Gets the service gateway token. This property is read-only and returns a string. ```APIDOC ## GatewayToken ### Description Property to get a service gateway token. ### Declaration ```csharp public string GatewayToken { get; } ``` ### Property Value - **Type**: string ``` -------------------------------- ### AuthenticationService Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.AuthenticationService.html Documentation for the AuthenticationService class, which serves as the entry point to the Authentication Service. It provides a static Instance property to access the default singleton instance. ```APIDOC ## Class AuthenticationService ### Description The entry class to the Authentication Service. Provides access to the default singleton instance of the authentication service. ### Inheritance object -> AuthenticationService ### Namespace Unity.Services.Authentication ### Assembly Unity.Services.Authentication.dll ### Syntax ```csharp public static class AuthenticationService ``` ### Properties #### Instance The default singleton instance to access the Authentication service. ##### Declaration ```csharp public static IAuthenticationService Instance { get; } ``` ##### Property Value | Type | Description | |------|-------------| | IAuthenticationService | The authentication service instance. | ##### Exceptions | Type | Condition | |------|-----------| | ServicesInitializationException | Thrown if `UnityServices.InitializeAsync()` has not finished before accessing the singleton. | ``` -------------------------------- ### SignInWithOculusAsync(string nonce, string userId, SignInOptions options = null) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using an Oculus account userId and nonce key. If no options are used, this will create an account if none exists. ```APIDOC ## SignInWithOculusAsync(string nonce, string userId, SignInOptions options = null) ### Description Sign in using an Oculus account userId and nonce key. If no options are used, this will create an account if none exists. ### Method SignInWithOculusAsync ### Parameters - **nonce** (string) - Required - Client provided nonce key used by the server to verify that the provided Oculus userId is valid - **userId** (string) - Required - Oculus account userId - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### SignInFromServerAsync() Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Server.IServerAuthenticationService.html Asynchronously retrieves a token to authorize server operations from a hosted server. ```APIDOC ## SignInFromServerAsync() ### Description Retrieve a token to authorize server operations from a hosted server. Must be running on a multiplay server or with the server local proxy activated. ### Declaration ```csharp Task SignInFromServerAsync() ``` ### Returns | Type | Description | |------|-------------| | Task | Task for the operation | ### Exceptions | Type | Condition | |------|-----------| | ServerAuthenticationException | The task fails with the exception when the task cannot complete successfully. | ``` -------------------------------- ### SignInWithServiceAccountAsync(string, string) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Server.IServerAuthenticationService.html Asynchronously signs in using service account credentials with all scopes. ```APIDOC ## SignInWithServiceAccountAsync(string, string) ### Description Trusted sign-in using service account credentials. Assigns all scopes associated to the service account. ### Declaration ```csharp Task SignInWithServiceAccountAsync(string apiKeyIdentifier, string apiKeySecret) ``` ### Parameters | Type | Name | Description | |------|------|-------------| | string | apiKeyIdentifier | The service account key id | | string | apiKeySecret | The service account key secret | ### Returns | Type | Description | |------|-------------| | Task | Task for the operation | ### Exceptions | Type | Condition | |------|-----------| | ServerAuthenticationException | The task fails with the exception when the task cannot complete successfully. | ``` -------------------------------- ### SignInWithUsernamePasswordAsync(string, string) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using Username and Password credentials. ```APIDOC ## SignInWithUsernamePasswordAsync(string, string) ### Description Sign in using Username and Password credentials. ### Method SignInWithUsernamePasswordAsync ### Parameters - **username** (string) - Required - Username of the player. Note that it must be unique per project and contains 3-20 characters of alphanumeric and/or these special characters [. - @ _]. - **password** (string) - Required - Password of the player. Note that it must contain 8-30 characters with at least 1 upper case, 1 lower case, 1 number, and 1 special character. ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### PlayerAccountService Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.PlayerAccounts.PlayerAccountService.html Documentation for the PlayerAccountService class, including its Instance property. ```APIDOC ## Class PlayerAccountService ### Description The entry class to the Player Account Service. Provides access to the default singleton instance of the service. ### Inheritance object -> PlayerAccountService ### Namespace Unity.Services.Authentication.PlayerAccounts ### Assembly Unity.Services.Authentication.PlayerAccounts.dll ### Syntax ```csharp public static class PlayerAccountService ``` ### Properties #### Instance The default singleton instance to access the Player Account service. ##### Declaration ```csharp public static IPlayerAccountService Instance { get; } ``` ##### Property Value | Type | Description | | --- | --- | | IPlayerAccountService | The singleton instance of the Player Account service. | ##### Exceptions | Type | Condition | | --- | --- | | ServicesInitializationException | Thrown if `UnityServices.InitializeAsync()` has not finished before accessing the singleton. | ``` -------------------------------- ### LinkOptions Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.LinkOptions.html Documentation for the LinkOptions class, including its ForceLink property. ```APIDOC ## Class LinkOptions ### Description Options for account linking operations. ### Inheritance object -> LinkOptions ### Namespace Unity.Services.Authentication ### Assembly Unity.Services.Authentication.dll ### Syntax ```csharp public sealed class LinkOptions ``` ### Properties #### ForceLink Option to force a link if one already exists. Using this option will remove the initial link if there is one. ##### Declaration ```csharp public bool ForceLink { get; set; } ``` ##### Property Value | Type | Description | |------|-------------| | bool | Indicates whether to force the link. | ``` -------------------------------- ### SignInWithServiceAccountAsync(string, string, List) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Server.IServerAuthenticationService.html Asynchronously signs in using service account credentials with specified scopes. ```APIDOC ## SignInWithServiceAccountAsync(string, string, List) ### Description Trusted sign-in using service account credentials. ### Declaration ```csharp Task SignInWithServiceAccountAsync(string apiKeyIdentifier, string apiKeySecret, List scopes) ``` ### Parameters | Type | Name | Description | |------|------|-------------| | string | apiKeyIdentifier | The service account key id | | string | apiKeySecret | The service account key secret | | List | scopes | The scopes to request | ### Returns | Type | Description | |------|-------------| | Task | Task for the operation | ### Exceptions | Type | Condition | |------|-----------| | ServerAuthenticationException | The task fails with the exception when the task cannot complete successfully. | ``` -------------------------------- ### SignInWithUnityAsync(string, SignInOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Signs in using a Unity Player Accounts access token. The token needs to be retrieved using the PlayerAccountService API. ```APIDOC ## SignInWithUnityAsync(string, SignInOptions) ### Description Sign in using a Unity Player Accounts access token. The token needs to be retrieved using the PlayerAccountService API. ### Method SignInWithUnityAsync ### Parameters - **token** (string) - Required - Unity Player Accounts access token - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the async operation ### Exceptions - **AuthenticationException** - Thrown when the task cannot complete successfully due to Authentication specific errors. Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or sign-in in progress. - **RequestFailedException** - Thrown when the task cannot complete successfully. Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. Throws with `ErrorCode` TransportError if the API call failed due to network error. Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. ``` -------------------------------- ### TargetingComponent Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.TargetingComponent.html Documentation for the TargetingComponent class, including its properties and methods. ```APIDOC ## TargetingComponent ### Description Manages targeting state, attributes, and release context for the current player session. ### Properties #### Attributes - **Type**: Attributes - **Description**: The targeting attributes that will be sent with the next sign-in or refresh request. #### Enabled - **Type**: bool - **Description**: Whether targeting is currently enabled. Returns the value set by SetEnabled(bool) if called, otherwise returns `true` when one or more packages have registered as targeting consumers. #### VariantTags - **Type**: string[] - **Description**: The variant tags assigned to this session by the server, or `null` if no release has been resolved. ### Methods #### ClearAppAttributes() - **Signature**: `public void ClearAppAttributes()` - **Description**: Clears any custom application attributes previously set by SetAppAttributes(object). #### ClearEnabled() - **Signature**: `public void ClearEnabled()` - **Description**: Clears any value set by SetEnabled(bool), restoring the default behavior where targeting is enabled automatically when registered consumers exist. #### ClearUserAttributes() - **Signature**: `public void ClearUserAttributes()` - **Description**: Clears any custom user attributes previously set by SetUserAttributes(object). #### RefreshAsync() - **Signature**: `public Task RefreshAsync()` - **Description**: Refreshes the current session using the stored session token, sending targeting attributes if targeting is enabled. - **Returns**: Task - A task for the refresh operation. - **Exceptions**: AuthenticationException - The task fails with the exception when the session token does not exist. #### SetAppAttributes(object) - **Signature**: `public void SetAppAttributes(object appAttributes)` - **Parameters**: - **appAttributes** (object) - An object whose properties will be serialized as application attributes. - **Description**: Sets custom application-scoped attributes to be included in targeting requests. #### SetEnabled(bool) - **Signature**: `public void SetEnabled(bool enabled)` - **Parameters**: - **enabled** (bool) - Set to `true` to enable targeting, or `false` to disable it. - **Description**: Explicitly enables or disables targeting, overriding the default behavior. By default, targeting is enabled automatically when any package registers as a consumer. Calling this method overrides that behavior. If set to `false` while registered consumers exist, a warning is logged. Call ClearEnabled() to restore the default consumer-based behavior. #### SetUserAttributes(object) - **Signature**: `public void SetUserAttributes(object userAttributes)` - **Parameters**: - **userAttributes** (object) - An object whose properties will be serialized as user attributes. - **Description**: Sets custom user-scoped attributes to be included in targeting requests. ``` -------------------------------- ### AuthenticationException Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.AuthenticationException.html Documentation for the AuthenticationException class, including its properties and methods. ```APIDOC ## Class AuthenticationException ### Description Represents a runtime exception from authentication. See AuthenticationErrorCodes for possible error codes. ### Inheritance object -> Exception -> RequestFailedException -> AuthenticationException ### Implements ISerializable ### Namespace Unity.Services.Authentication ### Assembly Unity.Services.Authentication.dll ### Syntax ```csharp public sealed class AuthenticationException : RequestFailedException, ISerializable ``` ### Remarks See AuthenticationErrorCodes for possible error codes. Consult the service documentation for specific error codes various APIs can return. ### Properties #### Notifications Caches the player's notifications if any are available or null if none are available. ##### Declaration ```csharp public List Notifications { get; } ``` ##### Property Value | Type | Description | |------|-------------| | List | The player's notifications, or null if none are available. | ### Methods #### Create(int, string, Exception) Creates the exception based on errorCode range. If the errorCode is less than AuthenticationErrorCodes.MinValue it creates a Unity.Services.Core.RequestFailedException. Otherwise it creates an AuthenticationException. ##### Declaration ```csharp public static RequestFailedException Create(int errorCode, string message, Exception innerException = null) ``` ##### Parameters | Type | Name | Description | |------|------|-------------| | int | errorCode | Gets the error code for the current exception. | | string | message | Gets a message that describes the current exception. | | Exception | innerException | Gets the Exception instance that caused the current exception. | ##### Returns | Type | Description | |------|-------------| | RequestFailedException | The built exception, either an AuthenticationException or a RequestFailedException. | ``` -------------------------------- ### LinkWithGoogleAsync(string, LinkOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Links the current player with a Google account using Google's ID token. ```APIDOC ## LinkWithGoogleAsync(string, LinkOptions) ### Description Link the current player with the Google account using Google's ID token. ### Method LinkWithGoogleAsync ### Signature ```csharp Task LinkWithGoogleAsync(string idToken, LinkOptions options = null) ``` ### Parameters - **idToken** (string) - Required - Google's ID token - **options** (LinkOptions) - Optional - Options for the link operations. ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` AccountAlreadyLinked if the player tries to link a social account while the social account is already linked with another player. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player is not authorized to perform this operation. - Throws with `ErrorCode` AccountLinkLimitExceeded if the player has already reached the limit of links for this provider type. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if access token is invalid/expired. The access token is refreshed before it expires. This may happen if the refresh fails, or the app is unpaused with an expired access token while the refresh hasn't finished. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### LinkWithAppleAsync(string, LinkOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Links the current player with an Apple account using Apple's ID token. ```APIDOC ## LinkWithAppleAsync(string, LinkOptions) ### Description Link the current player with the Apple account using Apple's ID token. ### Declaration ```csharp Task LinkWithAppleAsync(string idToken, LinkOptions options = null) ``` ### Parameters - **idToken** (string) - Required - Apple's ID token. - **options** (LinkOptions) - Optional - Options for the link operations. ### Returns - **Task** - Task for the operation. ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. Throws with `ErrorCode` AccountAlreadyLinked if the player tries to link a social account while the social account is already linked with another player. Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. Throws with `ErrorCode` ClientInvalidUserState if the player is not authorized to perform this operation. Throws with `ErrorCode` AccountLinkLimitExceeded if the player has already reached the limit of links for this provider type. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. Throws with `ErrorCode` InvalidToken if access token is invalid/expired. Throws with `ErrorCode` TransportError if the API call failed due to network error. Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. ``` -------------------------------- ### OnServicesReady() Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Components.PlayerAuthentication.html Called when the services registry is set and ready to be used. This method is a protected override of ServicesBehaviour.OnServicesReady(). ```APIDOC ## OnServicesReady() ### Description Called when the services registry is set and ready to be used. ### Declaration ``` protected override void OnServicesReady() ``` ### Overrides Unity.Services.Core.Components.ServicesBehaviour.OnServicesReady() ``` -------------------------------- ### LinkWithUnityAsync(string, LinkOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Links the current player with a Unity Player Accounts account using the Unity Player Accounts access token. ```APIDOC ## LinkWithUnityAsync(string, LinkOptions) ### Description Links the current player with a Unity Player Accounts account using the Unity Player Accounts access token. The token needs to be retrieved using the PlayerAccountService API. ### Method LinkWithUnityAsync ### Signature Task LinkWithUnityAsync(string token, LinkOptions options = null) ### Parameters - **token** (string) - Required - Unity Player Accounts access token - **options** (LinkOptions) - Optional - Options for the link operations ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` AccountAlreadyLinked if the player tries to link a social account while the social account is already linked with another player. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player is not authorized to perform this operation. - Throws with `ErrorCode` AccountLinkLimitExceeded if the player has already reached the limit of links for this provider type. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if access token is invalid/expired. The access token is refreshed before it expires. This may happen if the refresh fails, or the app is unpaused with an expired access token while the refresh hasn't finished. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### SignInWithOpenIdConnectAsync(string idProviderName, string idToken, SignInOptions options = null) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using a custom openID Connect id provider account. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithOpenIdConnectAsync(string idProviderName, string idToken, SignInOptions options = null) ### Description Sign in using a custom openID Connect id provider account. If no options are used, this will create an account if none exist. ### Method SignInWithOpenIdConnectAsync ### Parameters - **idProviderName** (string) - Required - the name of the id provider created. Note that it must start with _"oidc-"_ and have between 1 and 20 characters - **idToken** (string) - Required - Id Token for the custom id provider - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### AddUsernamePasswordAsync(string, string) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign up with a new Username/Password and add it to the current logged in user. ```APIDOC ## AddUsernamePasswordAsync(string, string) ### Description Sign up with a new Username/Password and add it to the current logged in user. ### Declaration ``` Task AddUsernamePasswordAsync(string username, string password) ``` ### Parameters - **username** (string) - Required - Username of the player. Note that it must be unique per project and contains 3-20 characters of alphanumeric and/or these special characters [. - @ _]. - **password** (string) - Required - Password of the player. Note that it must contain 8-30 characters with at least 1 upper case, 1 lower case, 1 number, and 1 special character. ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### LinkWithSteamAsync(string, string, LinkOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Links the current player with a Steam account using a session ticket and identity. ```APIDOC ## LinkWithSteamAsync(string, string, LinkOptions) ### Description Link the current player with the Steam account using Steam's session ticket. ### Declaration ```csharp Task LinkWithSteamAsync(string sessionTicket, string identity, LinkOptions options = null) ``` ### Parameters - **sessionTicket** (string) - Steam's session ticket - **identity** (string) - The identity of the calling service - **options** (LinkOptions) - Options for the link operations. Optional. ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - Thrown when the task cannot complete successfully due to Authentication specific errors. - `ErrorCode.AccountAlreadyLinked` if the player tries to link a social account while the social account is already linked with another player. - `ErrorCode.InvalidParameters` if parameter is empty or invalid. - `ErrorCode.ClientInvalidUserState` if the player is not authorized to perform this operation. - `ErrorCode.AccountLinkLimitExceeded` if the player has already reached the limit of links for this provider type. - **RequestFailedException** - Thrown when the task cannot complete successfully. - `ErrorCode.InvalidToken` if access token is invalid/expired. The access token is refreshed before it expires. This may happen if the refresh fails, or the app is unpaused with an expired access token while the refresh hasn't finished. - `ErrorCode.TransportError` if the API call failed due to network error. Check Unity logs for more debugging information. - `ErrorCode.Unknown` if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### LinkWithOculusAsync(string, string, LinkOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Links the current player with an Oculus account using a nonce and user ID. ```APIDOC ## LinkWithOculusAsync(string, string, LinkOptions) ### Description Link the current player with an Oculus account. ### Method LinkWithOculusAsync ### Signature ```csharp Task LinkWithOculusAsync(string nonce, string userId, LinkOptions options = null) ``` ### Parameters - **nonce** (string) - Required - Client provided nonce key used by the server to verify that the provided Oculus userId is valid. - **userId** (string) - Required - Oculus account userId. - **options** (LinkOptions) - Optional - Options for the operation. ### Returns - **Task** - Task for the operation. ### Exceptions - **AuthenticationException** - Thrown when the task cannot complete successfully due to Authentication specific errors. - `ErrorCode.AccountAlreadyLinked` if the player tries to link a social account while the social account is already linked with another player. - `ErrorCode.InvalidParameters` if parameter is empty or invalid. - `ErrorCode.ClientInvalidUserState` if the player is not authorized to perform this operation. - `ErrorCode.AccountLinkLimitExceeded` if the player has already reached the limit of links for this provider type. - **RequestFailedException** - Thrown when the task cannot complete successfully. - `ErrorCode.InvalidToken` if access token is invalid/expired. The access token is refreshed before it expires. This may happen if the refresh fails, or the app is unpaused with an expired access token while the refresh hasn't finished. - `ErrorCode.TransportError` if the API call failed due to network error. Check Unity logs for more debugging information. - `ErrorCode.Unknown` if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### IdProviderOptions.CreateCustomSettingsElementDelegate Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.Editor.IdProviderOptions.CreateCustomSettingsElementDelegate.html Delegate signature for creating a custom settings UI element for an ID provider. ```APIDOC ## Delegate IdProviderOptions.CreateCustomSettingsElementDelegate ### Description The delegate to create custom settings UI element for the ID provider. ### Namespace Unity.Services.Authentication.Editor ### Assembly Unity.Services.Authentication.Editor.dll ### Syntax ```csharp public delegate IdProviderCustomSettingsElement IdProviderOptions.CreateCustomSettingsElementDelegate(string projectId, Func servicesGatewayTokenCallback, bool skipConfirmation) ``` ### Parameters - **projectId** (string) - The project ID - **servicesGatewayTokenCallback** (Func) - The callback action to get the service gateway token. It makes sure the token is up to date. - **skipConfirmation** (bool) - Whether or not to skip the UI confirmation. ### Returns - **IdProviderCustomSettingsElement** - The additional ID provider settings element. ``` -------------------------------- ### SignInWithGooglePlayGamesAsync(string, SignInOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using Google Play Games' authorization code. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithGooglePlayGamesAsync(string, SignInOptions) ### Description Sign in using Google Play Games' authorization code. If no options are used, this will create an account if none exist. ### Declaration ```csharp Task SignInWithGooglePlayGamesAsync(string authCode, SignInOptions options = null) ``` ### Parameters - **authCode** (string) - Required - Google Play Games' authorization code - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### LinkWithSteamAsync(string, string, string, LinkOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Links the current player with a Steam account using a session ticket, identity, and app ID. ```APIDOC ## LinkWithSteamAsync(string, string, string, LinkOptions) ### Description Link the current player with the Steam account using Steam's session ticket. ### Declaration ```csharp Task LinkWithSteamAsync(string sessionTicket, string identity, string appId, LinkOptions options = null) ``` ### Parameters - **sessionTicket** (string) - Steam's session ticket - **identity** (string) - The identity of the calling service - **appId** (string) - App Id that was used to generate the ticket. Only required for additional app ids (e.g.: PlayTest, Demo, etc) - **options** (LinkOptions) - Options for the link operations. Optional. ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - Thrown when the task cannot complete successfully due to Authentication specific errors. - `ErrorCode.AccountAlreadyLinked` if the player tries to link a social account while the social account is already linked with another player. - `ErrorCode.InvalidParameters` if parameter is empty or invalid. - `ErrorCode.ClientInvalidUserState` if the player is not authorized to perform this operation. - `ErrorCode.AccountLinkLimitExceeded` if the player has already reached the limit of links for this provider type. - **RequestFailedException** - Thrown when the task cannot complete successfully. - `ErrorCode.InvalidToken` if access token is invalid/expired. The access token is refreshed before it expires. This may happen if the refresh fails, or the app is unpaused with an expired access token while the refresh hasn't finished. - `ErrorCode.TransportError` if the API call failed due to network error. Check Unity logs for more debugging information. - `ErrorCode.Unknown` if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ``` -------------------------------- ### SignInWithFacebookAsync(string, SignInOptions) Source: https://docs.unity3d.com/Packages/com.unity.services.authentication%403.8/api/Unity.Services.Authentication.IAuthenticationService.html Sign in using Facebook's access token. If no options are used, this will create an account if none exist. ```APIDOC ## SignInWithFacebookAsync(string, SignInOptions) ### Description Sign in using Facebook's access token. If no options are used, this will create an account if none exist. ### Declaration ```csharp Task SignInWithFacebookAsync(string accessToken, SignInOptions options = null) ``` ### Parameters - **accessToken** (string) - Required - Facebook's access token - **options** (SignInOptions) - Optional - Options for the operation ### Returns - **Task** - Task for the operation ### Exceptions - **AuthenticationException** - The task fails with the exception when the task cannot complete successfully due to Authentication specific errors. - Throws with `ErrorCode` InvalidParameters if parameter is empty or invalid. - Throws with `ErrorCode` ClientInvalidUserState if the player has already signed in or a sign-in operation is in progress. - **RequestFailedException** - The task fails with the exception when the task cannot complete successfully. - Throws with `ErrorCode` InvalidToken if the server side returned an invalid access token. - Throws with `ErrorCode` TransportError if the API call failed due to network error. Check Unity logs for more debugging information. - Throws with `ErrorCode` Unknown if the API call failed due to unexpected response from the server. Check Unity logs for more debugging information. ```