Data Factory Linked Service REST Oauth2

Anonymous
2022-02-18T08:23:08.297+00:00

Hi All,

we're trying to connect to a Rest API with defining a Linked Service REST connection, which has Oauth2ClientCredential. There is no documentation about it and we cannot seem to figure it out how to set this up.

The process we have to deal with is the following:

  1. Call authentication api to authenticate, which redirects us to a URL which has parameter with code (endpoint "/auth")
  2. Call "/token" on authentication api and use that parameter from step 1 inside the Authorization Header (same url as above, except different endpoint "/token")
  3. Call resource api with the token from step 2 to fetch the data (has different URL that the one in step 1 & 2)

Anyone managed to do this with Oauth2ClientCredential? Or any other way?

175744-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,352 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. VFX Pro 5 Reputation points
    2024-08-19T03:36:31.97+00:00

    This must a be joke. Why can't we use Data Factory and simply authenticate with a bearer token. Microsoft, constantly missing the mark.

    1 person found this answer helpful.
    0 comments No comments

  2. ShaikMaheer-MSFT 38,516 Reputation points Microsoft Employee
    2022-02-21T09:05:09.027+00:00

    Hi @Anonymous ,

    Thank you for posting query in Microsoft Q&A Platform.

    If I understand the query correctly, you are looking a way to make API call which works based on Bearer token. You see "OAuth2ClientCredential" authentication type but not sure how to use it. Please feel free to correct me if my understanding here is wrong.

    As per REST connector documentation, authenticationType supported are Anonymous, Basic, AadServicePrincipal, and ManagedServiceIdentity. User-based OAuth isn't supported. Click here to know more about same. But linked service configuration details shows OAuth authentication as well.

    I escalated this matter internally to which more details on this. I will share updates soon once I here back from internal team.

    As a worked we can consider using Web activity to make API call and get Bearer token and then take token from web activity output json and pass it to main API call to do our desired work. Kindly check below link where similar work-around discussion happened.
    https://learn.microsoft.com/en-us/answers/questions/52665/how-can-we-authenticate-rest-api-endpoint-via-api.html

    Hope this helps. Please let us know if any further queries.


    Please consider hitting Accept Answer. Accepted answers helps community as well.


  3. Juan Montoya 6 Reputation points
    2022-12-21T22:35:06.247+00:00

    Same situation: we're trying to connect to a Rest API with defining a Linked Service REST connection, which has Oauth2ClientCredential.

    After entering all the parameters and test the connection we get the following error"

    The toke type 'bearer' from your authorization server is not supported, supported types: 'Bearer'.

    Any suggestion will be appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.