docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ServiceAccountAuthorizer

    An Unity.Cloud.Common.IServiceAuthorizer implementation that expects service account credentials from a provided launch argument or environment variable.

    Inheritance
    object
    ServiceAccountAuthorizer
    Implements
    IServiceAuthorizer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cloud.Identity
    Assembly: Unity.Cloud.Identity.dll
    Syntax
    public class ServiceAccountAuthorizer : IServiceAuthorizer
    Examples
    public class ServiceAccountAuthorizerExample : MonoBehaviour
    {
        IServiceAuthorizer m_ServiceAccountAuthorizer;
    
        void Awake()
        {
            var authenticationPlatformSupport = PlatformSupportFactory.GetAuthenticationPlatformSupport();
            m_ServiceAccountAuthorizer = new ServiceAccountAuthorizer(authenticationPlatformSupport);
        }
    }

    Constructors

    ServiceAccountAuthorizer(IAuthenticationPlatformSupport)

    Returns an IAuthenticator implementation that expects service account credentials from a provided launch argument or environment variable.

    Declaration
    public ServiceAccountAuthorizer(IAuthenticationPlatformSupport authenticationPlatformSupport)
    Parameters
    Type Name Description
    IAuthenticationPlatformSupport authenticationPlatformSupport

    The IAuthenticationPlatformSupport that handles credential injection.

    Remarks

    The Unity service account must be created for the correct organization and have the correct permissions to access Unity Cloud APIs.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if no service account credentials are provided as a launch argument or environment variable.

    Fields

    s_ServiceAccountKeyName

    Returns the expected key name in launch arguments that holds the service account credentials in the <key id>:<secret key> format.

    Declaration
    public static readonly string s_ServiceAccountKeyName
    Field Value
    Type Description
    string

    Methods

    AddAuthorization(HttpHeaders)

    Applies authorization information to a given set of HttpHeaders.

    Declaration
    public Task AddAuthorization(HttpHeaders headers)
    Parameters
    Type Name Description
    HttpHeaders headers

    The HttpHeaders to add authorization information to.

    Returns
    Type Description
    Task

    A Task for the operation.

    Exceptions
    Type Condition
    ArgumentNullException

    Thrown if headers is null.

    Implements

    Unity.Cloud.Common.IServiceAuthorizer
    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)