Need to retrieve headers of an API call via gateway script.
Currently we are using different headers configurations:
1. Basic Authorization headers (username and pass) // not having problem with this
2. Normal headers -
key - Authorization value - Bearer AAIkNTYzOTk4OWItNTU1My00NDMzLWE5NjUtYmQ3NDZmMGY2ZTY34uoi2mc9Bg4rwo4BNXAdwyb- (Token)
Currently I retrive headers of category and its value by the following code:
var Category = apim.getvariable('message.headers.Category'); /// Able to successfully get this value
But when I use the same for Authorization ; I do not get that token..
Also i tried other alternatives
var hm = require('header-metadata');
var Authorization = hm.current.get('Authorization');
myAppConsoleLog.error('InpToken=' + Authorization);
var InpToken = apim.getvariable('message.headers.Authorization');
Kindly suggest. Thanks in advance
FYI: I create Token using Provider APis and that Token is passsed on API call in headers along with category as header