docs.unity3d.com
    Show / Hide Table of Contents

    Interface IAuthenticationService

    The functions for Authentication service.

    Namespace: Unity.Services.Authentication
    Syntax
    public interface IAuthenticationService

    Properties

    AccessToken

    Returns the current player's access token when they are signed in, otherwise null.

    Declaration
    string AccessToken { get; }
    Property Value
    Type Description
    String

    IsAuthorized

    Checks whether the player is still authorized. A player is authorized as long as his access token remains valid.

    Declaration
    bool IsAuthorized { get; }
    Property Value
    Type Description
    Boolean

    Returns true if player is authorized, else false.

    IsExpired

    Checks whether the player session is expired.

    Declaration
    bool IsExpired { get; }
    Property Value
    Type Description
    Boolean

    Returns true if player's session expired.

    IsSignedIn

    Checks whether the player is signed in or not. A player can remain signed in but have an expired session.

    Declaration
    bool IsSignedIn { get; }
    Property Value
    Type Description
    Boolean

    Returns true if player is signed in, else false.

    PlayerId

    Returns the current player's ID when they are signed in, otherwise null.

    Declaration
    string PlayerId { get; }
    Property Value
    Type Description
    String

    PlayerInfo

    Returns the current player's info, including linked identities.

    Declaration
    PlayerInfo PlayerInfo { get; }
    Property Value
    Type Description
    PlayerInfo

    Profile

    The profile isolates the values saved to the PlayerPrefs. You can use profiles to sign in to multiple accounts on a single device. Use the SwitchProfile(String) method to change this value.

    Declaration
    string Profile { get; }
    Property Value
    Type Description
    String

    SessionTokenExists

    Check if there is an existing session token stored for the current profile.

    Declaration
    bool SessionTokenExists { get; }
    Property Value
    Type Description
    Boolean

    Methods

    ClearSessionToken()

    Deletes the session token if it exists.

    Declaration
    void ClearSessionToken()
    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player is not signed out.

    DeleteAccountAsync()

    Deletes the currently signed in player permanently.

    Declaration
    Task DeleteAccountAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player is not authorized to perform this operation.

    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.

    GetPlayerInfoAsync()

    Returns the info of the logged in player, which includes the player's id, creation time and linked identities.

    Declaration
    Task<PlayerInfo> GetPlayerInfoAsync()
    Returns
    Type Description
    Task<PlayerInfo>

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player is not authorized to perform this operation.

    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)

    Link the current player with the Apple account using Apple's ID token.

    Declaration
    Task LinkWithAppleAsync(string idToken, LinkOptions options = null)
    Parameters
    Type Name Description
    String idToken

    Apple's ID token

    LinkOptions options

    Options for the link operations.

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    LinkWithFacebookAsync(String, LinkOptions)

    Link the current player with the Facebook account using Facebook's access token.

    Declaration
    Task LinkWithFacebookAsync(string accessToken, LinkOptions options = null)
    Parameters
    Type Name Description
    String accessToken

    Facebook's access token

    LinkOptions options

    Options for the link operations.

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    LinkWithGoogleAsync(String, LinkOptions)

    Link the current player with the Google account using Google's ID token.

    Declaration
    Task LinkWithGoogleAsync(string idToken, LinkOptions options = null)
    Parameters
    Type Name Description
    String idToken

    Google's ID token

    LinkOptions options

    Options for the link operations.

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    LinkWithGooglePlayGamesAsync(String, LinkOptions)

    Link the current player with the Google play games account using Google play games' authorization code.

    Declaration
    Task LinkWithGooglePlayGamesAsync(string authCode, LinkOptions options = null)
    Parameters
    Type Name Description
    String authCode

    Google play games' authorization code

    LinkOptions options

    Options for the link operations.

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    LinkWithOculusAsync(String, String, LinkOptions)

    Link the current player with an Oculus account

    Declaration
    Task LinkWithOculusAsync(string nonce, string userId, LinkOptions options = null)
    Parameters
    Type Name Description
    String nonce

    Client provided nonce key used by the server to verify that the provided Oculus userId is valid

    String userId

    Oculus account userId

    LinkOptions options

    Options for th operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    LinkWithOpenIdConnectAsync(String, String, LinkOptions)

    Link the current player with a custom openID Connect id provider account.

    Declaration
    Task LinkWithOpenIdConnectAsync(string idProviderName, string idToken, LinkOptions options = null)
    Parameters
    Type Name Description
    String idProviderName

    the name of the id provider created. Note that it must start with "oidc-" and have between 1 and 20 characters

    String idToken

    Id Token for the custom id provider

    LinkOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    LinkWithSteamAsync(String, LinkOptions)

    Link the current player with the Steam account using Steam's session ticket.

    Declaration
    Task LinkWithSteamAsync(string sessionTicket, LinkOptions options = null)
    Parameters
    Type Name Description
    String sessionTicket

    Steam's session ticket

    LinkOptions options

    Options for the link operations.

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignInAnonymouslyAsync(SignInOptions)

    Signs in the current player anonymously. No credentials are required and the session is confined to the current device.

    Declaration
    Task SignInAnonymouslyAsync(SignInOptions options = null)
    Parameters
    Type Name Description
    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Remarks

    If a player has signed in previously with a session token stored on the device, they are signed back in regardless of if they're an anonymous player or not.

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • 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.

    SignInWithAppleAsync(String, SignInOptions)

    Sign in using Apple's ID token. If no options are used, this will create an account if none exist.

    Declaration
    Task SignInWithAppleAsync(string idToken, SignInOptions options = null)
    Parameters
    Type Name Description
    String idToken

    Apple's ID token

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignInWithFacebookAsync(String, SignInOptions)

    Sign in using Facebook's access token. If no options are used, this will create an account if none exist.

    Declaration
    Task SignInWithFacebookAsync(string accessToken, SignInOptions options = null)
    Parameters
    Type Name Description
    String accessToken

    Facebook's access token

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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)

    Sign in using Google's ID token. If no options are used, this will create an account if none exist.

    Declaration
    Task SignInWithGoogleAsync(string idToken, SignInOptions options = null)
    Parameters
    Type Name Description
    String idToken

    Google's ID token

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignInWithGooglePlayGamesAsync(String, SignInOptions)

    Sign in using Google Play Games' authorization code. If no options are used, this will create an account if none exist.

    Declaration
    Task SignInWithGooglePlayGamesAsync(string authCode, SignInOptions options = null)
    Parameters
    Type Name Description
    String authCode

    Google Play Games' authorization code

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignInWithOculusAsync(String, String, SignInOptions)

    Sign in using an Oculus account userId and nonce key If no options are used, this will create an account if none exists

    Declaration
    Task SignInWithOculusAsync(string nonce, string userId, SignInOptions options = null)
    Parameters
    Type Name Description
    String nonce

    Client provided nonce key used by the server to verify that the provided Oculus userId is valid

    String userId

    Oculus account userId

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignInWithOpenIdConnectAsync(String, String, SignInOptions)

    Sign in using a custom openID Connect id provider account. If no options are used, this will create an account if none exist.

    Declaration
    Task SignInWithOpenIdConnectAsync(string idProviderName, string idToken, SignInOptions options = null)
    Parameters
    Type Name Description
    String idProviderName

    the name of the id provider created. Note that it must start with "oidc-" and have between 1 and 20 characters

    String idToken

    Id Token for the custom id provider

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignInWithSteamAsync(String, SignInOptions)

    Sign in using Steam's session ticket. If no options are used, this will create an account if none exist.

    Declaration
    Task SignInWithSteamAsync(string sessionTicket, SignInOptions options = null)
    Parameters
    Type Name Description
    String sessionTicket

    Steam's session ticket

    SignInOptions options

    Options for the operation

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    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.

    SignOut(Boolean)

    Sign out the current player.

    Declaration
    void SignOut(bool clearCredentials = false)
    Parameters
    Type Name Description
    Boolean clearCredentials

    Option to clear the session token that enables logging in to the same account

    SwitchProfile(String)

    Switch the current profile. You can use profiles to sign in to multiple accounts on a single device. A profile isolates the values saved to the PlayerPrefs. The profile may only contain alphanumeric values, -, _, and must be no longer than 30 characters. The player must be signed out for this operation to succeed.

    Declaration
    void SwitchProfile(string profile)
    Parameters
    Type Name Description
    String profile

    The profile to switch to.

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player is not signed out.
    • Throws with ErrorCode ClientInvalidProfile if the profile name is invalid.

    UnlinkAppleAsync()

    Unlinks the Apple account from the current player account.

    Declaration
    Task UnlinkAppleAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    UnlinkFacebookAsync()

    Unlinks the Facebook account from the current player account.

    Declaration
    Task UnlinkFacebookAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    UnlinkGoogleAsync()

    Unlinks the Google account from the current player account.

    Declaration
    Task UnlinkGoogleAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    UnlinkGooglePlayGamesAsync()

    Unlinks the Google play games account from the current player account.

    Declaration
    Task UnlinkGooglePlayGamesAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    UnlinkOculusAsync()

    Unlinks the Oculus account from the current player account

    Declaration
    Task UnlinkOculusAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    UnlinkOpenIdConnectAsync(String)

    Unlinks the custom openID Connect id provider account from the current player account.

    Declaration
    Task UnlinkOpenIdConnectAsync(string idProviderName)
    Parameters
    Type Name Description
    String idProviderName

    the name of the id provider created. Note that it must start with "oidc-" and have between 1 and 20 characters

    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    UnlinkSteamAsync()

    Unlinks the Steam account from the current player account.

    Declaration
    Task UnlinkSteamAsync()
    Returns
    Type Description
    Task

    Task for the operation

    Exceptions
    Type Condition
    AuthenticationException

    The task fails with the exception when the task cannot complete successfully due to Authentication specific errors.

    • Throws with ErrorCode ClientInvalidUserState if the player has not authorized to perform this operation.
    • Throws with ErrorCode ClientUnlinkExternalIdNotFound if the player's PlayerInfo does not have a matching external id.

    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.

    Events

    Expired

    Invoked when a session expires.

    Declaration
    event Action Expired
    Event Type
    Type Description
    Action

    SignedIn

    Invoked when a sign-in attempt has completed successfully.

    Declaration
    event Action SignedIn
    Event Type
    Type Description
    Action

    SignedOut

    Invoked when a sign-out attempt has completed successfully.

    Declaration
    event Action SignedOut
    Event Type
    Type Description
    Action

    SignInFailed

    Invoked when a sign-in attempt has failed. The reason for failure is passed as the parameter RequestFailedException AuthenticationException.

    Declaration
    event Action<RequestFailedException> SignInFailed
    Event Type
    Type Description
    Action<RequestFailedException>
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023