docs.unity3d.com
    Show / Hide Table of Contents

    Interface IServerAuthenticationService

    The functions for the Server Authentication service.

    Namespace: Unity.Services.Authentication.Server
    Syntax
    public interface IServerAuthenticationService

    Properties

    AccessToken

    Returns the current access token, otherwise null.

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

    IsAuthorized

    Validates that the state is authorized.

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

    Returns true if there is a valid non-expired token.

    State

    The current state of the service

    Declaration
    ServerAuthenticationState State { get; }
    Property Value
    Type Description
    ServerAuthenticationState

    Methods

    ClearCredentials()

    Clears the access token and authorization state.

    Declaration
    void ClearCredentials()

    SignInFromServerAsync()

    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
    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)

    Trusted sign-in using service account credentials

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

    Events

    AuthorizationFailed

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

    Declaration
    event Action<ServerAuthenticationException> AuthorizationFailed
    Event Type
    Type Description
    Action<ServerAuthenticationException>

    Authorized

    Invoked when an authorization attempt has completed successfully.

    Declaration
    event Action Authorized
    Event Type
    Type Description
    Action

    Expired

    Invoked when an access token expires.

    Declaration
    event Action Expired
    Event Type
    Type Description
    Action
    Back to top
    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