Thomas
Thomas

Reputation: 29736

Azure Data Factory - REST Linked Service - OAuth2 Client Credentials

From Azure Data Factory, I'm trying to connect to a REST service that requires an access token (OAuth2). Tried in Postman with the client credentials flow (client_id/client_secret) and it works fine:

  1. Calling the token endpoint to get an access_token
  2. Use the token in a subsequent request to retrieve data.

I configured the linked service like that as It supposed to support the OAuth2 client credentials flow:

enter image description here

But when testing the connection, it fails with this message:

The request body must contain the following parameter: 'client_secret'.

I don't really understand why the client_secret is not added in the request body as it is a client credentials flow.

Not sure if I'm missing some configuration ? For the moment, I'm using Web Activity as a workaround.

enter image description here

Upvotes: 1

Views: 3478

Answers (1)

Abhishek Khandave
Abhishek Khandave

Reputation: 3240

This error may occurred because Allow public client flows is disabled for the application registered in Azure AD.

Enabling it may fixed the issue.

Refer - https://learn.microsoft.com/en-us/azure/data-factory/parameterize-linked-services?tabs=data-factory

enter image description here

Refer - https://learn.microsoft.com/en-gb/azure/active-directory/develop/scenario-desktop-acquire-token?tabs=python#username-and-password

enter image description here

Upvotes: 0

Related Questions