Press "Enter" to skip to content

Prevent users needing to enter an API Key in Power Automate

We receive lots of support calls where users have created a Flow associated to a SharePoint document library or a Flow associated with a PowerApp which they have then shared with their team or organisation… however, each user accessing the Flow is prompted to enter an API Key for an action for which the connector uses API Key authentication… less than ideal!

How do you avoid this? (SharePoint Library)

I have set up the following example Flow associated with a SharePoint Library:

As the user who created the Flow I can see the option to invoke the Flow, other users will not yet be able to see the Flow:

To share the Flow and the contained connections simply follow these steps negating the need for users to enter either credentials or an API Key to use the actions / connections embedded within the Flow:

STEP 1: Share the Flow

1. Navigate to your Flows in Power Automate, select your target flow and click ‘‘, click ‘Details

2. Inside the ‘Run only users‘ block, click ‘Edit

REFERENCE: https://docs.microsoft.com/en-us/business-applications-release-notes/april18/microsoft-flow/sharepoint-lists-libraries

The referenced article is an excellent resource, we typically recommend granting the list / library run only permissions as this negates the need to separately manage permissions between the Flow and the list / library in future.

3. Click ‘SharePoint

4. Select the Site where the Flow is contained and the library to which the Flow is associated, click ‘Add

Once these changes are saved your flow will be visible to all users who have read/write access to the SharePoint document library.

STEP 2: Share the connections

By default, all connections used by actions within the flow will be set to ‘Provided by run-only user‘, which means each user who attempts to execute the flow must set up their own connections.

When a user attempts to run the flow for the first time they are prompted to create the connections.

Connecters which use OAuth will prompt the user to sign-in, connectors which use API Key authentication (Like Encodian) will prompt the user to enter an API Key, not ideal!

To prevent this we simply need to set each connection to use an existing connection and not require the user to create a new one.

NOTE: If there are tasks which you would prefer are executed as the current user (Like creating a new document) it makes sense to ask the user to create the connection, however for the Encodian connector there is no benefit and we fully recommend you share an existing connection.

1. Click on the drop-down list of the connection you wish to share

2. Select one of the existing connections

3. Click ‘OK

4. Repeat as required for any other connection within your flow.

5. Click ‘Save

The connections within the example flow will now be shared negating the need for an end-user to create new connections, which we think really simplifies the experience

Let’s validate…

Every user who has read /write to the library will now be able to execute the Flow:

Upon selecting the Flow, users will simply click ‘Run Flow‘… no need to create new connections!

… and the flow will execute using the shared connections:

Finally…

For explicitness, we will create another post shortly providing detailed steps on how to do this with Flows used by a PowerApp, noting the steps within Flow are identical to the steps outlined within this post.

We hope you’ve found this post useful, and as ever, please share any feedback or comments – all are welcome!

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *