I am able to make a successful POSTMAN call to: /mfp/api/az/v1/token and /mfpadmin/management-apis/2.0/runtimes/mfp/applications
I am taking the bearer token i receive from /mfp/api/az/v1/token and add it to the Authorization header for /mfp/applications.
I receive a 200 response from both and get the expected information from each API.
I then choose to copy the ajax code from POSTMAN for each of these working API Calls:
var getBasic = {
"async": true,
"crossDomain": true,
"url": "https://..../mfp/api/az/v1/token",
"method": "POST",
"headers": {
"authorization": "Basic YXBpYzptZnBhcGlj",
"grant_type": "client_credentials",
"cache-control": "no-cache",
"postman-token": "05a672e5-6141-fd6f-82e2-b282d68dce35",
"content-type": "application/x-www-form-urlencoded"
},
"data": {
"grant_type": "client_credentials",
"scope": "settings.read"
}
}
$.ajax(getBasic).done(function (response) {
console.log(response);
var accessToken = response.access_token;
console.log(accessToken);
var settings = {
"async": true,
"crossDomain": true,
"url": "https://....:8445/mfpadmin/management-apis/2.0/runtimes/mfp/applications",
"method": "GET",
"headers": {
"authorization": "Bearer " + accessToken,
"cache-control": "no-cache"
}
}
console.log(settings);
$.ajax(settings).done(function (response) {
console.log("response: " + response.totalListSize);
});
});
However, when i run this in my WebUI I get a 200 response from the /token but i get a 401(Unauthorized) from my /mfp/applications
Why does this work in postman, but not from the Web UI (Chrome)?