cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KoenJanssensPD
Post Patron
Post Patron

How to use custom authentication request in next request

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

0 REPLIES 0

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,336)