Pass Token Information for Triggering Workflows in the AIM Repository via a Custom App
- Last UpdatedJul 04, 2025
- 1 minute read
Pass Token Information for Triggering Workflows in the AIM Repository via a Custom App
To execute a workflow on a repository configured with the "Active Directory with Token Service" i.e AIM provider, authorization is required. Ensure that you pass the access token when triggering the workflow.
Sample code 1:
string repository = "ADRepoWithAim";
string workflowName="First Workflow";
string accessToken = ""; // set the access token received from the above API.
UserContext userContext = new UserContext("username", new Skelta.Core.ApplicationObject(repository), "activedirectory");
HttpContext.Current.Request.Headers.Add("AccessToken", accessToken);
Workflow.NET.Engine.Client client = new Workflow.NET.Engine.Client(repository, workflowName);
client.Execute(userContext.LoggedInUserId, "<test></test>");
client.Close();
If you are using a console application or any non-web application, refer to the sample
below:
Sample code 2:
Skelta.ASTS.Core.ClientTokenData clientTokenData = new Skelta.ASTS.Core.ClientTokenData();
clientTokenData.AccessToken = accessToken;
Workflow.NET.Engine.Client client1 = new Workflow.NET.Engine.Client(repository, workflowName, clientTokenData);
client1.Execute(userContext.LoggedInUserId, "<test></test>");
client1.Close();