Class OneComputePlatformClientAuthenticatorNativeAutoRefresh
The specialized authenticator when using "native/interactive" authentication flow, with auto-refresh of the access token.
Inheritance
Inherited Members
Namespace: DNVGL.One.Compute.Platform.Client.Extensions
Assembly: DNVGL.One.Compute.Platform.Client.Extensions.dll
Syntax
public class OneComputePlatformClientAuthenticatorNativeAutoRefresh : OneComputePlatformClientAuthenticatorBase
Constructors
View SourceOneComputePlatformClientAuthenticatorNativeAutoRefresh(String, String, String)
Initializes a new instance of the OneComputePlatformClientAuthenticatorNativeAutoRefresh class.
Declaration
public OneComputePlatformClientAuthenticatorNativeAutoRefresh(string ocpBaseUrl, string ocpApiId, string clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | ocpBaseUrl | The OneCompute REST API URL (base address). |
| System.String | ocpApiId | The OneCompute REST API (Veracity) identifier. |
| System.String | clientId | The client application (Veracity) identifier. |
Properties
View SourceClientAuthenticationRedirectUri
Gets or sets an optional client authentication redirect URI.
Declaration
public string ClientAuthenticationRedirectUri { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
UseAuthenticationEmbeddedWebView
Gets or sets a value indicating whether to use an embedded web view to display the login view or not (the default is false).
Declaration
public bool UseAuthenticationEmbeddedWebView { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
Note that this option should be used with caution, and has only been included for backward compatibility with older client applications.
For more details, see https://www.rfc-editor.org/rfc/rfc8252.txt.
Methods
View SourceConstructLocalTokenCacheAppPath()
Constructs the local disk path to where the token cache should be stored.
Declaration
public static string ConstructLocalTokenCacheAppPath()
Returns
| Type | Description |
|---|---|
| System.String | A local disk path to the token cache. |
Remarks
The path will be in context of the current user's OS profile, whether it's in Windows or Linux (handled automatically by the runtime).
This is logically intended to be a "private" method, but has been elevated to "public" for now, to support a multi-user scenario for a client application, during development. TODO: When we get an official request for multi-user support, we need to refactor this.
GetAccessTokenAsync()
Declaration
public override async Task<string> GetAccessTokenAsync()
Returns
| Type | Description |
|---|---|
| Task<System.String> |
Overrides
View SourceUseDiskBasedTokenCache(String)
Use a disk-based token cache, rather than just the default of in-memory.
Declaration
public void UseDiskBasedTokenCache(string clientAppName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | clientAppName | The name of the client application to cache access tokens for. |
Remarks
This enables caching the access token across multiple executions of the given client application.