3

I'm designing a Logic App in Azure, is there any way to make two HTTP request like this : 1. I'm calling my Identity Server 4 to get a new access token 2. I want to get the access token from the first request, put it to header and call .Net Core Api Endpoint with it?

Thanks

3
  • 1
    Sorry, are we missing something? The situation you describe is pretty basic. What is the complication? Commented May 15, 2019 at 13:37
  • I didn't know how to get the response from the first HTTP request in Azure, i found the solution : with Parsed Json Action on Azure Logic app Commented May 16, 2019 at 6:58
  • Glad to see you solve it by yourself. You could post it as answer. Commented May 16, 2019 at 7:10

2 Answers 2

3

per my understanding, you want to know how to get access_token value from a JSON object which comes from response of get token http request . I did a simple demo for you : enter image description here

The details of the post request : enter image description here

This is a simple request to get access token in Azure. the response will be :

{
    "token_type": "Bearer",
    "expires_in": "3600",
    "ext_expires_in": "3600",
    "expires_on": "1557995356",
    "not_before": "1557991456",
    "resource": "<-resource name->",
    "access_token": "<-value of access token->"
}

As you can see this logic app is triggered by http request and it will do a post request to get an JSON object which contains an access_token. And finally it will return the access_token value in response .

So the key here is how to config so that we can get access_token value from the JSON response of step2 .

Let's open logic app code view, find "response" =>"body" and modify its value as : "@body('HTTP').access_token"

enter image description here

So that you can get the certain param from your JSON response of previous http request : enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

You can use the response of the first request by using Parsing JSON action. enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.