Skip to main content

Notifications

Power Apps - Connector Development
Unanswered

How to use custom authentication request in next request

(0) ShareShare
ReportReport
Posted on by 593

Dear,

 

I am trying to create a custom connector for a third party API that uses a custom authentication method.

It basically needs two calls, one for getting an accesstoken, and one for getting the data (using the accesstoken). I don't know how I can implement this two-step flow in a custom connector.

 

The first call is: 

curl --location --request POST 'https://thirdpartyurl.com/api/v2/users/me/login' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'email=myemail@mydomain.com' \
--data-urlencode 'password=xxxxxxxxxxxxxxxxxxxxxxxxxxxx'

which returns a JSON:

{
 "data": {
 "serverTime": "xxxxx",
 "accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
 "accessTokenExpiration": "xxxxxx",
 "refreshToken": "xxxxxxxxxxxxxxxxxx",
 "refreshTokenExpiration": "xxxxxxxxxxxxxxxxxxxxx",
 "authType": "user"
 }
}

 

the second call is:

curl --location --request GET 'https://thirdpartyurl.com/api/v2/data' \
--header 'Authorization: Bearer myaccesstokenfrompreviousrequest'

 

I have no idea how to setup this "custom" authentication model in the custom connector so I can call the "data" request so that it uses the other "authentication" request...

Are there any samples or specific tutorials available somewhere that explain this?

 

Thanks,

Koen

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,636

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,942

Leaderboard

Featured topics