Class CommandLineAccessTokenProvider
An IAccessTokenProvider implementation that expects an access token value from a provided -DT_ACCESS_TOKEN launch argument.
Implements
Unity.DigitalTwins.Common.IAccessTokenProvider
Inherited Members
Namespace: Unity.DigitalTwins.Identity
Assembly: solution.dll
Syntax
public class CommandLineAccessTokenProvider : IAccessTokenProvider
Constructors
CommandLineAccessTokenProvider(IActivatePlatformSupport)
Returns an IAccessTokenProvider implementation that expects an access token value from a provided -DT_ACCESS_TOKEN launch argument.
Declaration
public CommandLineAccessTokenProvider(IActivatePlatformSupport platformSupport)
Parameters
Type | Name | Description |
---|---|---|
IActivatePlatformSupport | platformSupport | The IActivatePlatformSupport that handles launch arguments processing. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown if no access token is provided in launch arguments. |
Fields
s_AccessTokenKeyName
The expected key name in launch arguments that holds the access token value.
Declaration
public static readonly string s_AccessTokenKeyName
Field Value
Type | Description |
---|---|
String |
Methods
GetAccessTokenAsync()
Awaitable call to fetch the user access token.
Declaration
public Task<string> GetAccessTokenAsync()
Returns
Type | Description |
---|---|
Task<String> | A Task that results in the string value of the user access token when completed. |
Implements
Unity.DigitalTwins.Common.IAccessTokenProvider