This must a be joke. Why can't we use Data Factory and simply authenticate with a bearer token. Microsoft, constantly missing the mark.
Data Factory Linked Service REST Oauth2
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:
- Call authentication api to authenticate, which redirects us to a URL which has parameter with code (endpoint "/auth")
- Call "/token" on authentication api and use that parameter from step 1 inside the Authorization Header (same url as above, except different endpoint "/token")
- 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?
3 answers
Sort by: Most helpful
-
-
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.htmlHope this helps. Please let us know if any further queries.
Please consider hitting
Accept Answer
. Accepted answers helps community as well. -
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.