Genpact Cora Knowledge Center


Configure File Writer Activity with OAuth



Use the File Writer activity to create, edit, and save a file into the database as part of a workflow. After you create the file, you can access and use its data in other activities.

You can configure File Writer activity with OAuth for authentication. To do so you need to follow the steps below: 

  1. Configure the web.config.
  2. Configure the File Writer credentials.
  3. Configure ApplicationId user.

1. Configure the web.config

In the web.config file, make sure you have the following:

  • A sectionGroup called identity with the following sections:
    • openIdConnect
    • oauth
  • Authentication configured correctly with following parameters:
    • Email and username.
    • AppId 
    • Client identifier (application id, for example 7c374b9e-8feb-469a-b0e5-15fdba23fcb2 in this case).
    • Tenant id (For example aefc6520-97fa-44e4-9c87-250eb7be74e3 in this case).
    • Endpoint (v1 in this case), for example -
    • Scope
    • Custom location with your custom runtime.aspx page copied and renamed to GeneratePDF.aspx (you can name it as you want).
  • Modules
    • OAuthBearerAuthenticationModule

2. Configure the File Writer credentials

  • Configure Custom page name and credentials in the File Properties window.
    In custom credentials make sure you have (if you work with same application id in Azure, then it's as above):
    • Client Identifier
    • Client Secret
    • Token
    • Scope

3. Configure ApplicationId user

Because we have added appid claim in the web.config, the application id will be used for authentication when the File Writer tries to access Cora Orchestration from a url.

Make sure the appid user has runtime workflow permissions of the viewer of the form that you want to print.

To run it in the Administration debugger, the user must be an administrator or a developer.

The File Writer activity can now work with OAuth authentication.

For PDF generation, in case you don't need input elements in the PDF, it's suggested to use read only form or section.