cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CycladelicT
New Member

Custom Connector to Azure API using Oauth 2.0

I'm attempting to integrate my PowerApps UI application with an Azure Data Factory instance using the Azure Service Management API (https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/provi...).  I understand that I need to create a custom connector in order to do this and that I'll need to use Oauth 2.0 for authentication.  I've registered my PowerApps application in my company's Azure Active Directory on our portal so that I have a client_id and client secret for it.  I'm not a Web developer, so Oauth 2.0 authentication is new to me, but I've learned the basics of it. 

I completed the General tab with the schema info below: 

CycladelicT_1-1649720641666.png

 

It's on the Security tab of my custom connector that I'm not quite sure which Identity Provider I should use, either Generic Oauth 2.0 or Azure Active Directory to access the Azure Service Management API.  I started with Generic Oauth 2.0 and here's a screenshot of everything (minus the client ID and secret info).

CycladelicT_0-1649720186057.png

I've completed the Definition tab with no issues and then I proceed to the Test tab.  And that's where it all goes bad 😄

 

I'm getting this:

Body:

{
"error": {
"code": "AuthenticationFailed",
"message": "Authentication failed."
}
}

 

Headers

{
"cache-control": "no-cache",
"content-length": "76",
"content-type": "application/json; charset=utf-8",
"date": "Mon, 11 Apr 2022 23:47:16 GMT",
"expires": "-1",
"pragma": "no-cache",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"www-authenticate": "Bearer authorization_uri=\"https://login.windows.net/335a6d75-c3eb-4b1a-ac08-d49338816ca0\", error=\"invalid_token\", error_description=\"Could not find identity for access token.\"",
"x-content-type-options": "nosniff",
"x-ms-apihub-cached-response": "false",
"x-ms-apihub-obo": "true",
"x-ms-correlation-request-id": "86db93c0-5b2a-4f32-85fc-0ae2e9740885",
"x-ms-failure-cause": "gateway",
"x-ms-request-id": "86db93c0-5b2a-4f32-85fc-0ae2e9740885",
"x-ms-routing-request-id": "NORTHCENTRALUS:20220411T234717Z:86db93c0-5b2a-4f32-85fc-0ae2e9740885"
}

 

One additional note: Prior to creating this custom connector, I verified that I can call the Azure Service Mgmt API (using Postman) and change objects within an Azure Data Factory instance using it.

 

I've tried multiple different permutations and combinations on the Security tab.  I've even tried Azure Active Directory as the Identity Provider as well, with the same or similar results.  At this point, any assistance is greatly appreciated 😬

 

1 ACCEPTED SOLUTION

Accepted Solutions
CycladelicT
New Member

This problem has been resolved.

View solution in original post

2 REPLIES 2
CycladelicT
New Member

This problem has been resolved.

remyadeepu0206
New Member

Please share the solution to connect APIM and Powerapps with oAuth token policy showing Unauthorized

.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Solution Authors
Top Kudoed Authors
Users online (1,622)