docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PlayerAuthenticationApi

    Represents a collection of functions to interact with the API endpoints

    Inheritance
    object
    PlayerAuthenticationApi
    Implements
    IPlayerAuthenticationApi
    IApiAccessor
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Services.Apis.PlayerAuthentication
    Assembly: solution.dll
    Syntax
    public class PlayerAuthenticationApi : IPlayerAuthenticationApi, IApiAccessor

    Constructors

    PlayerAuthenticationApi(IApiClient)

    Initializes a new instance of the PlayerAuthenticationApi class using a Configuration object and client instance.

    Declaration
    public PlayerAuthenticationApi(IApiClient apiClient)
    Parameters
    Type Name Description
    IApiClient apiClient

    The client interface for synchronous API access.

    PlayerAuthenticationApi(IApiClient, IApiConfiguration)

    Initializes a new instance of the PlayerAuthenticationApi class using a Configuration object and client instance.

    Declaration
    public PlayerAuthenticationApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
    Parameters
    Type Name Description
    IApiClient apiClient

    The client interface for synchronous API access.

    IApiConfiguration apiConfiguration

    The configuration object.

    Properties

    Client

    The client for accessing this underlying API asynchronously.

    Declaration
    public IApiClient Client { get; }
    Property Value
    Type Description
    IApiClient

    Configuration

    Gets the configuration object

    Declaration
    public IApiConfiguration Configuration { get; }
    Property Value
    Type Description
    IApiConfiguration

    An instance of the Configuration

    Methods

    CodeConfirmation(string, string, string, CodeLinkConfirmationRequest, CancellationToken)

    Code Confirmation Allow a user to sign in to this account using this code

    Declaration
    public ApiOperation CodeConfirmation(string projectId, string unityEnvironment = null, string authorization = null, CodeLinkConfirmationRequest codeLinkConfirmationRequest = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CodeLinkConfirmationRequest codeLinkConfirmationRequest

    Code confirmation request. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation

    The operation

    DeletePlayer(string, string, string, CancellationToken)

    Delete Player Delete the player.

    Declaration
    public ApiOperation DeletePlayer(string playerId, string projectId, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string playerId

    This is the player id.

    string projectId

    This is the Unity Project Id. It is a uuid format.

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation

    The operation

    GenerateCode(string, string, GenerateCodeRequest, CancellationToken)

    Generate Code Generates a sign in code for an unauthenticated device.

    Declaration
    public ApiOperation<GenerateCodeResponse> GenerateCode(string projectId, string unityEnvironment = null, GenerateCodeRequest generateCodeRequest = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    GenerateCodeRequest generateCodeRequest

    Generate Code Request Body (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<GenerateCodeResponse>

    The operation

    GetBasePath()

    Gets the base path of the API client.

    Declaration
    public string GetBasePath()
    Returns
    Type Description
    string

    The base path

    GetCodeInfo(string, CodeLinkInfoRequest, string, CancellationToken)

    Get Code Info Get code information including the identifier and expiration.

    Declaration
    public ApiOperation<CodeLinkInfoResponse> GetCodeInfo(string projectId, CodeLinkInfoRequest codeLinkInfoRequest, string unityEnvironment = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    CodeLinkInfoRequest codeLinkInfoRequest

    Code Link Request for Sign In

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<CodeLinkInfoResponse>

    The operation

    GetJSONWebKeySet(CancellationToken)

    Get JWKS Get the JSON Web Key Set for validating authentication tokens.

    Declaration
    public ApiOperation<JSONWebKeySet> GetJSONWebKeySet(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<JSONWebKeySet>

    The operation

    GetPlayer(string, string, string, CancellationToken)

    Get Player Get the information for a player.

    Declaration
    public ApiOperation<PlayerResponse> GetPlayer(string playerId, string projectId, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string playerId

    This is the player id.

    string projectId

    This is the Unity Project Id. It is a uuid format.

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<PlayerResponse>

    The operation

    LinkExternalId(string, string, LinkExternalIdRequest, string, CancellationToken)

    Link External Id Link an External Id to a Unity Authentication account

    Declaration
    public ApiOperation<LinkExternalIdResponse> LinkExternalId(string idProvider, string projectId, LinkExternalIdRequest linkExternalIdRequest, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string idProvider

    This is the id provider type.

    string projectId

    This is the Unity Project Id. It is a uuid format.

    LinkExternalIdRequest linkExternalIdRequest

    Link External Id request body

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<LinkExternalIdResponse>

    The operation

    ReadNotifications(string, string, string, CancellationToken)

    Read Notification Gets a player's notifications to be displayed by the client.

    Declaration
    public ApiOperation<ReadNotificationsResponse> ReadNotifications(string playerId, string projectId, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string playerId

    This is the player id.

    string projectId

    This is the Unity Project Id. It is a uuid format.

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<ReadNotificationsResponse>

    The operation

    SignInWithCode(string, string, SignInWithCodeRequest, string, CancellationToken)

    Sign In With Code Tries to sign in a user with code. In the case this returns 200 and an empty response, poll at regular intervals, 2-5s to avoid being rate limited, until you receive a different response.

    Declaration
    public ApiOperation<AuthenticationResponse> SignInWithCode(string projectId, string codeLinkSessionId, SignInWithCodeRequest signInWithCodeRequest, string unityEnvironment = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    string codeLinkSessionId

    An identifier for the device requesting the code sign in.

    SignInWithCodeRequest signInWithCodeRequest

    Code Link Request for Sign In

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    SignInWithCustomID(string, CustomIDRequest, string, CancellationToken)

    Custom ID Sign In Sign In using a Custom ID

    Declaration
    public ApiOperation<AuthenticationResponse> SignInWithCustomID(string projectId, CustomIDRequest customIDRequest, string unityEnvironment = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    CustomIDRequest customIDRequest

    Custom ID Request for Sign In

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    SignInWithExternalToken(string, string, SignInWithExternalTokenRequest, string, CancellationToken)

    External Token Sign In Authenticate players using external token. The external tokens are from login providers, such as Facebook.

    Declaration
    public ApiOperation<AuthenticationResponse> SignInWithExternalToken(string idProvider, string projectId, SignInWithExternalTokenRequest signInWithExternalTokenRequest, string unityEnvironment = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string idProvider

    This is the id provider type.

    string projectId

    This is the Unity Project Id. It is a uuid format.

    SignInWithExternalTokenRequest signInWithExternalTokenRequest

    External Token Authentication request body

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    SignInWithSessionToken(string, SignInWithSessionTokenRequest, string, CancellationToken)

    Session Token Sign In Authenticate players using the session token. Store the session token in a persistent storage in the app or on device.

    Declaration
    public ApiOperation<AuthenticationResponse> SignInWithSessionToken(string projectId, SignInWithSessionTokenRequest signInWithSessionTokenRequest, string unityEnvironment = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    SignInWithSessionTokenRequest signInWithSessionTokenRequest

    Session Token Authentication request body

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    SignInWithUsernamePassword(string, UsernamePasswordRequest, string, CancellationToken)

    Username Password Sign In Sign in using the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.

    Declaration
    public ApiOperation<AuthenticationResponse> SignInWithUsernamePassword(string projectId, UsernamePasswordRequest usernamePasswordRequest, string unityEnvironment = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    UsernamePasswordRequest usernamePasswordRequest

    The Username and Password of the player.

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    SignUpAnonymously(string, string, SignUpAnonymouslyRequest, CancellationToken)

    Anonymous Sign Up Sign-up a new anonymous player.

    Declaration
    public ApiOperation<AuthenticationResponse> SignUpAnonymously(string projectId, string unityEnvironment = null, SignUpAnonymouslyRequest signUpAnonymouslyRequest = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    SignUpAnonymouslyRequest signUpAnonymouslyRequest

    Anonymous Sign Up request body (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    SignUpWithUsernamePassword(string, UsernamePasswordRequest, string, string, CancellationToken)

    Username Password Sign Up Create a new player for the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.

    Declaration
    public ApiOperation<AuthenticationResponse> SignUpWithUsernamePassword(string projectId, UsernamePasswordRequest usernamePasswordRequest, string unityEnvironment = null, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    UsernamePasswordRequest usernamePasswordRequest

    The Username and Password of the player.

    string unityEnvironment

    This is the Environment you want to authorize a player to access. It is the name of the Environment. If this header is not specified, then the default Environment is used. An invalid environment name is not an acceptable input. (optional)

    string authorization

    This is the bearer token for the user authorized to call this API. When this is provided, a user associated with the bearer token is used instead of creating a new user. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    UnlinkExternalId(string, string, UnlinkExternalIdRequest, string, CancellationToken)

    Unlink External Id Unlink an external account from a Unity Authentication account.

    Declaration
    public ApiOperation<UnlinkExternalIdResponse> UnlinkExternalId(string idProvider, string projectId, UnlinkExternalIdRequest unlinkExternalIdRequest, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string idProvider

    This is the id provider type.

    string projectId

    This is the Unity Project Id. It is a uuid format.

    UnlinkExternalIdRequest unlinkExternalIdRequest

    Unlink external Id request body

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<UnlinkExternalIdResponse>

    The operation

    UsernamePasswordUpdatePassword(string, UsernamePasswordPasswordUpdateRequest, string, CancellationToken)

    Username Password Update Password Update the password of a player using the Username Password IdProvider. Store the session token in a persistent storage in the app or on device.

    Declaration
    public ApiOperation<AuthenticationResponse> UsernamePasswordUpdatePassword(string projectId, UsernamePasswordPasswordUpdateRequest usernamePasswordPasswordUpdateRequest, string authorization = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string projectId

    This is the Unity Project Id. It is a uuid format.

    UsernamePasswordPasswordUpdateRequest usernamePasswordPasswordUpdateRequest

    The Username, current Password and new Password of the player.

    string authorization

    This is the bearer token for the user authorized to call this API. (optional)

    CancellationToken cancellationToken

    Cancellation Token to cancel the request.

    Returns
    Type Description
    ApiOperation<AuthenticationResponse>

    The operation

    Implements

    IPlayerAuthenticationApi
    IApiAccessor
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)