- BrowserPreferences
- CustomUrlAuthenticator
- LocalhostAuthenticator
- #ctor(endpointProvider,consumerKey,scopes,productName)
- IsLoggedIn
- LegacyTokenProvider
- TokenProvider
- Dispose()
- Dispose(disposing)
- GetUserInfo()
- LoadCachedLogin()
- Login(silent,timeoutInMs,cancellationToken)
- Logout(singleSignOut,cancellationToken)
- WithBrowserPreferences(preferences)
- WithFixedPort(port)
- WithLoopbackAddress(address)
- WithPersistentStorage(persistentStorage)
- LocalhostListener
- TokenProviderWrapper
Trimble.ID.Desktop
Trimble.ID.Desktop
Public constructor for CustomUrlAuthenticator class
Name | Type | Description |
---|---|---|
tokenProvider | Trimble.ID.AuthorizationCodeGrantTokenProvider | An authorization Grant token provider object |
productName | System.String | The product name of the consuming application (optional). |
Log the user in
true if the user was successfully logged in
Name | Type | Description |
---|---|---|
silent | System.Boolean | true if no UI should be shown i.e. prompt=none |
timeoutInMs | System.Int32 | Specify the length of time that client waits for a login response when making a login attempt. The default timeout value is 3 minutes. |
Name | Description |
---|---|
System.TimeoutException | Login operation has timed out after waiting for specified time. |
Fluent method to specify browser preferences
Name | Type | Description |
---|---|---|
preferences | Trimble.ID.Desktop.BrowserPreferences | The browser preferences |
Trimble.ID.Desktop
An authenticator that utilizes a localhost callback
const string CONFIGURATION_ENDPOINT = "https://id.trimble.com/.well-known/openid-configuration";
const string CONSUMER_KEY = "APPLICATION_CONSUMER_KEY";
var string SCOPES = new [] { "CSharpSDKTesting" };
IEndpointProvider endpointProvider = new OpenIdEndpointProvider(new Uri(CONFIGURATION_URL, UriKind.Absolute));
IAuthenticator authenticator = new LocalhostAuthenticator(endpointProvider, CONSUMER_KEY, SCOPES);
if (await authenticator.Login())
{
var userInfo = await authenticator.GetUserInfo();
var token = await authenticator.TokenProvider.RetrieveToken();
}
await authenticator.Logout(singleSignOut: true);
authenticator.Dispose();
Implements IAuthenticator
Public constructor for LocalhostAuthenticator class
Name | Type | Description |
---|---|---|
endpointProvider | Trimble.ID.IEndpointProvider | An endpoint provider that provides the URL for the Trimble Identity authorization and token endpoints |
consumerKey | System.String | The consumer key for the calling application |
scopes | System.String[] | The scopes used in the authorization request, openid is specified by default |
productName | System.String | The product name of the consuming application (optional). |
Get the logged in state
Get the token provider for this authenticator
This token provider can be used with other SDK components
Get the token provider for this authenticator
This token provider can be used with other SDK components
Dispose method for LocalhostAuthenticator class
This method has no parameters.
Dispose of instance
Name | Type | Description |
---|---|---|
disposing | System.Boolean | True if disposing |
Validates the ID token and returns user claims
User claims from the ID token
This method has no parameters.
Initialize the authenticator with a stored refresh token
true if the authenticator was initialzed with an existing refresh token
This method has no parameters.
Log the user in
true if the user was successfully logged in
Name | Type | Description |
---|---|---|
silent | System.Boolean | true if no UI should be shown i.e. prompt=none |
timeoutInMs | System.Int32 | Specify the length of time that client waits for a login response when making a login attempt. The default timeout value is 3 minutes. |
cancellationToken | System.Threading.CancellationToken | The optional cancellation token. |
Name | Description |
---|---|
System.TimeoutException | Login operation has timed out after waiting for specified time. |
System.Threading.Tasks.TaskCanceledException | Task is canceled when cancellation token is requested and the operation might takes longer time to respond |
Only one login or logout operation is permitted at a time, all previously started operations will return false
Log the user out
true if the user was successfully logged out
Name | Type | Description |
---|---|---|
singleSignOut | System.Boolean | true if the single sign in session should be terminated |
cancellationToken | System.Threading.CancellationToken | The optional cancellation token. |
Name | Description |
---|---|
System.Threading.Tasks.TaskCanceledException | Task is canceled when cancellation token is requested and the operation might takes longer time to respond |
Only one login or logout operation is permitted at a time, all previously started operations will return false
Fluent method to specify browser preferences
Name | Type | Description |
---|---|---|
preferences | Trimble.ID.Desktop.BrowserPreferences | The browser preferences |
Fluent method to specify a fixed port
Name | Type | Description |
---|---|---|
port | System.Int32 | The fixed port to use for the localhost listener |
Fluent method to specify an alternative host
Name | Type | Description |
---|---|---|
address | System.String | The alternative host to use for the localhost listener |
Fluent method to specify persistent storage option. This initializes to load cached login first if present
Name | Type | Description |
---|---|---|
persistentStorage | Trimble.ID.IPersistantStorage | The persistent storage for refresh tokens |
Trimble.ID.Desktop
Constructor for localhost listener
Name | Type | Description |
---|---|---|
address | System.String | The host address to listen on, default 127.0.0.1 |
Dispose method for LocalhostListener class
This method has no parameters.
Frees the resources used by the LocalhostListener object.
Name | Type | Description |
---|---|---|
disposing | System.Boolean | A boolean value indicating whether the method is being called |
Start a listener on the specified port
true on success
Name | Type | Description |
---|---|---|
port | System.Int32 | The port to start the listener on, or ANY_PORT |
Trimble.ID.Desktop.LocalhostAuthenticator
Retrieves the access token.
The access token.
This method has no parameters.
Retrieves the access token.
An AccessToken which can be used to authenticate service client calls.
Name | Type | Description |
---|---|---|
cancellationToken | System.Threading.CancellationToken | A CancellationToken controlling the request lifetime. |