Connect-FLC
Authenticates and prepares a connection for communicating to the specified Fusion Manage tenant.
Syntax
Connect-FLC -Tenant <String> -ClientId <String> -ClientSecret <String> [-UserId <String>] [<CommonParameters>]
Parameters
Type |
Name |
Description |
Default Value |
Optional |
|---|---|---|---|---|
String |
Tenant |
Name of your Fusion Manage tenant. Usually the first part of the URL: |
No |
|
String |
ClientId |
The Client ID of your Autodesk App. This is your app’s username required for the two-legged authentication on APS |
No |
|
String |
ClientSecret |
The Client Secret is your app’s password and can be found next to the Client ID in the My Apps section. |
No |
|
String |
UserId |
The email address of the user (for example a system user) who will perform all subsequent requests to Fusion Manage. |
If a Vault connection exists: email of the current Vault user; |
Yes |
Return type
Bool:
$true ← on success.
$false ← on failure with an additional property ‘Error’ containing the Exception/ErrorMessage.
Remarks
Authentication to the Fusion Manage Tenant is achieved through the 2-legged OAuth flow.
The cmdlet requests an access token using the provided -ClientId and -ClientSecret. This token is then used to communicate with your tenant.
Instructions on how to create your Autodesk App, find the Client ID and Client Secret, and whitelist the Client ID in your tenant are available here:
Create and Whitelist your Autodesk App
Since the 2-legged OAuth flow is not tied to a particular user, the e-mail address of a specific system user can be provided using the -UserId parameter.
The cmdlet can be invoked without -UserId in applications already connected to Vault (for example, Vault Client or the Job Processor):
Job Processor: The email of the Vault user who queued the the currently processed job is automatically used for the login.
Other Vault applications: The email of the logged-in Vault user is used.
When the connection to Fusion Manage is successfully the PowerShell variable $flcConnection is created, allowing direct communication with your tenant through the Fusion Manage REST APIs.
If a connection for the specified tenant already exists, the cmdlet reuses it instead of creating a new one. The $flcConnection variable remains available in the current session, and $flcConnection.UserId is updated if necessary to reflect the current user correctly.
Examples
Connect to Fusion Manage using a specific Autodesk account (e.g., system user on Job Processor)
Connect-FLC -Tenant 'previewcoolorange' -ClientId 'nkerZQhAFEgt9f23Jk8aQ6B2NeRaLSjU' -ClientSecret 'w68qUITbY8RTjGCh' -UserId 'info@coolorange.com'
Connect using an existing powerVault connection
Open-VaultConnection -User 'coolOrange' # Vault user 'coolorange' has email address 'info@coolorange.com' assigned
Connect-FLC -Tenant 'previewcoolorange' -ClientId 'nkerZQhAFEgt9f23Jk8aQ6B2NeRaLSjU' -ClientSecret 'w68qUITbY8RTjGCh'
$flcConnection.UserId # Returns 'info@coolorange.com'
Error handling, analyze why the connection could not be established
$result = Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId 'your_email@example.com'
if(-not $result) {
$result.Error #Returns "Authentication to Fusion Manage failed!"
}