I am new to logic apps and am trying to build an Auth request workflow to obtain a token for re-use in subsequent requests.
The API I am connecting to requires that I first sign-in using a username and password in the body of the initial request. Assuming authentication is successful, it will return a token in the response header 'Authorization'.
I receive a successful authentication message in the body of the response but no Authorization header is displayed and I can only presume this is for security reasons?
If this is the expected behaviour, could someone point me towards how to obtain the auth token and store it securely for the subsequent requests?
Request sent:
{
"uri": "https://URL",
"method": "POST",
"headers": {
"Accept": "text/html",
"Authorization": "*sanitized*",
"Content-Type": "application/json"
},
"body": {
"password": "USERNAME",
"username": "PASSWORD" }
}
Response Received:
{
"statusCode": 200,
"headers": {
"Vary": "Accept-Encoding",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept, Authorization",
"Access-Control-Expose-Headers": "accept, authorization, content-type",
"X-Frame-Options": "SAMEORIGIN",
"X-XSS-Protection": "1; mode=block",
"Cache-Control": "private",
"Date": "Fri, 23 Feb 2018 18:01:36 GMT",
"X-Powered-By": "ASP.NET",
"Content-Type": "text/html",
"Content-Length": "60"
},
"body": "{\"ErrorUsernameOrPasswordIncorrect\":false,\"Successful\":true}"
}
Many thanks.
Nigel