docs.unity3d.com
    Show / Hide Table of Contents

    Class BasePkcePlatformSupport

    This class contains platform shared logic to handle the authentication flow.

    Inheritance
    Object
    BasePkcePlatformSupport
    EditorActivatePlatformSupport
    IosPkcePlatformSupport
    WebglActivatePlatformSupport
    WindowsActivatePlatformSupport
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Identity
    Syntax
    public class BasePkcePlatformSupport : IAuthenticationPlatformSupport, IActivatePlatformSupport

    Constructors

    BasePkcePlatformSupport(IUrlRedirectionInterceptor, IUrlProcessor, IAppIdProvider, IAppNameProvider, String, String)

    Creates a BasePkcePlatformSupport that handles app activation from an url or key value pairs.

    Declaration
    public BasePkcePlatformSupport(IUrlRedirectionInterceptor urlRedirectionInterceptor, IUrlProcessor urlProcessor, IAppIdProvider appIdProvider, IAppNameProvider appNameProvider, string cacheStorePath, string activationUrl = null)
    Parameters
    Type Name Description
    IUrlRedirectionInterceptor urlRedirectionInterceptor

    An IUrlRedirectionInterceptor that manages url redirection interception.

    IUrlProcessor urlProcessor
    IAppIdProvider appIdProvider
    IAppNameProvider appNameProvider
    String cacheStorePath
    String activationUrl

    An optional activation URL

    Fields

    m_LoginUrl

    The url used to initiate a login operation in the default OS browser.

    Declaration
    protected string m_LoginUrl
    Field Value
    Type Description
    String

    m_UrlProcessor

    Declaration
    protected readonly IUrlProcessor m_UrlProcessor
    Field Value
    Type Description
    IUrlProcessor

    Properties

    ActivationKeyValue

    Retrieves the key value pairs used to activate the application.

    Declaration
    public virtual Dictionary<string, string> ActivationKeyValue { get; protected set; }
    Property Value
    Type Description
    Dictionary<String, String>
    Implements
    IActivatePlatformSupport.ActivationKeyValue

    ActivationUrl

    Retrieves the URL used to activate the application.

    Declaration
    public virtual string ActivationUrl { get; protected set; }
    Property Value
    Type Description
    String
    Implements
    IActivatePlatformSupport.ActivationUrl

    CodeVerifierCacheStore

    The code verifier cache store used in authenticated redirection flow.

    Declaration
    public virtual IKeyValueStore CodeVerifierCacheStore { get; }
    Property Value
    Type Description
    IKeyValueStore
    Implements
    IAuthenticationPlatformSupport.CodeVerifierCacheStore

    HostUrl

    Retrieves the URL used to activate the application.

    Declaration
    public virtual string HostUrl { get; protected set; }
    Property Value
    Type Description
    String
    Implements
    IActivatePlatformSupport.HostUrl

    SecretCacheStore

    The secret cache store used in authenticated redirection flow.

    Declaration
    public virtual IKeyValueStore SecretCacheStore { get; }
    Property Value
    Type Description
    IKeyValueStore
    Implements
    IAuthenticationPlatformSupport.SecretCacheStore

    UrlRedirectionInterceptor

    The IUrlRedirectionInterceptor monitoring URL redirection requests.

    Declaration
    public virtual IUrlRedirectionInterceptor UrlRedirectionInterceptor { get; }
    Property Value
    Type Description
    IUrlRedirectionInterceptor
    Implements
    IAuthenticationPlatformSupport.UrlRedirectionInterceptor

    Methods

    ExportServiceAuthorizerToken(String, String)

    Exports the token and its token type used to authorize Service endpoints call.

    Declaration
    public virtual void ExportServiceAuthorizerToken(string type, string token)
    Parameters
    Type Name Description
    String type

    Authorization type for the token (Bearer or Basic).

    String token

    The token string value.

    Implements
    IAuthenticationPlatformSupport.ExportServiceAuthorizerToken(String, String)

    GetAppStateOverride()

    Gets a string override for the default random state parameter used in authenticated redirection flows.

    Declaration
    public virtual string GetAppStateOverride()
    Returns
    Type Description
    String

    This method returns a string override of the default random state or null if no override is defined.

    Implements
    IAuthenticationPlatformSupport.GetAppStateOverride()

    GetCancellationUri()

    Gets the cancellation URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(String, List<String>).

    Declaration
    public virtual string GetCancellationUri()
    Returns
    Type Description
    String

    The cancellation URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(String, List<String>).

    Implements
    IAuthenticationPlatformSupport.GetCancellationUri()
    Exceptions
    Type Condition
    InvalidOperationException

    Thrown if the app isn't awaiting a URL redirection response.

    GetRedirectionResult()

    No UrlRedirectResult expected at app initializing time.

    Declaration
    public virtual UrlRedirectResult? GetRedirectionResult()
    Returns
    Type Description
    Nullable<UrlRedirectResult>

    A null value.

    Implements
    IAuthenticationPlatformSupport.GetRedirectionResult()

    GetRedirectUri(String)

    Gets the redirection URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(String, List<String>).

    Declaration
    public virtual string GetRedirectUri(string operation = null)
    Parameters
    Type Name Description
    String operation

    Optional string to append to the path of the redirect URI

    Returns
    Type Description
    String

    The redirection URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(String, List<String>).

    Implements
    IAuthenticationPlatformSupport.GetRedirectUri(String)

    GetRedirectUriAsync(String)

    Gets the redirection URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(String, List<String>).

    Declaration
    public virtual Task<string> GetRedirectUriAsync(string operation = null)
    Parameters
    Type Name Description
    String operation

    Optional string to append to the path of the redirect URI

    Returns
    Type Description
    Task<String>

    The redirection URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(String, List<String>).

    Implements
    IAuthenticationPlatformSupport.GetRedirectUriAsync(String)

    OpenUrlAndWaitForRedirectAsync(String, List<String>)

    Creates a pending task that starts by opening a URL in a browser and is completed when response is intercepted, validated and returns a UrlRedirectResult.

    Declaration
    public virtual async Task<UrlRedirectResult> OpenUrlAndWaitForRedirectAsync(string url, List<string> awaitedQueryArguments = null)
    Parameters
    Type Name Description
    String url

    The URL to open. It must trigger a redirection to the URI referenced by GetRedirectUri(String).

    List<String> awaitedQueryArguments

    The list of query arguments to validate when receiving the awaited callback url.

    Returns
    Type Description
    Task<UrlRedirectResult>

    A task that results in a UrlRedirectResult when completed.

    Implements
    IAuthenticationPlatformSupport.OpenUrlAndWaitForRedirectAsync(String, List<String>)
    Exceptions
    Type Condition
    TimeoutException

    Thrown if no redirect occurred within the allotted time limit.

    ProcessActivationUrl(List<String>)

    Processes activation URL to either complete a URL redirection flow or consume an authenticated app resource.

    Declaration
    public virtual void ProcessActivationUrl(List<string> awaitedQueryArguments = null)
    Parameters
    Type Name Description
    List<String> awaitedQueryArguments

    The list of query arguments to validate when processing the activation URL.

    Implements
    IAuthenticationPlatformSupport.ProcessActivationUrl(List<String>)
    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