Class EditorPkcePlatformSupport
This class handles Unity Editor platform-specific features in the authentication flow.
Inherited Members
Namespace: Unity.Cloud.Identity.Runtime
Assembly: Unity.Cloud.Identity.Runtime.dll
Syntax
public class EditorPkcePlatformSupport : EditorActivatePlatformSupport, IAuthenticationPlatformSupport, IActivatePlatformSupport
Constructors
EditorPkcePlatformSupport(IUrlRedirectionInterceptor, IUrlProcessor, IAppIdProvider, IAppNamespaceProvider, string, string)
Creates a BasePkcePlatformSupport that handles app activation from an url or key value pairs.
Declaration
public EditorPkcePlatformSupport(IUrlRedirectionInterceptor urlRedirectionInterceptor, IUrlProcessor urlProcessor, IAppIdProvider appIdProvider, IAppNamespaceProvider appNamespaceProvider, string cacheStorePath, string activationUrl = null)
Parameters
Type | Name | Description |
---|---|---|
IUrlRedirectionInterceptor | urlRedirectionInterceptor | An Unity.Cloud.AppLinking.IUrlRedirectionInterceptor that manages url redirection interception. |
IUrlProcessor | urlProcessor | An Unity.Cloud.AppLinking.IUrlProcessor that manages url processing after interception. |
IAppIdProvider | appIdProvider | An Unity.Cloud.Common.IAppIdProvider instance. |
IAppNamespaceProvider | appNamespaceProvider | An Unity.Cloud.Common.IAppNamespaceProvider instance. |
string | cacheStorePath | A full path to a readable/writable directory. |
string | activationUrl | An optional activation URL. |
Methods
GetCancellationUri()
Gets the cancellation URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(string, List<string>).
Declaration
public override string GetCancellationUri()
Returns
Type | Description |
---|---|
string | The cancellation URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(string, List<string>). |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if the app isn't awaiting a URL redirection response. |
GetRedirectUri(string)
Gets the redirection URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(string, List<string>).
Declaration
public override 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>). |
Overrides
GetRedirectUriAsync(string)
Gets the redirection URI expected from the browser when calling OpenUrlAndWaitForRedirectAsync(string, List<string>).
Declaration
public override 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>). |
Overrides
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 Unity.Cloud.AppLinking.UrlRedirectResult.
Declaration
public override 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 Unity.Cloud.AppLinking.UrlRedirectResult when completed. |
Overrides
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 override 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. |