
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2020 09:42 PM
I've been trying to get the HTTP request proxy to work and so far it's working perfectly in the instance once deployed but I suspect there's something wrong with my proxy configuration because it's not authenticating when I run "now-cli develop".
now-cli.json is:
{
"development": {
"proxy": {
"origin": "https://dev100***service-now.com",
"headers": {
"Authorization": "Basic SGFoYSB5b3UgdGhpbmsgdGhpcyB3b3VsZCBiZSBteSByZWFsIHBhc3N3b3J"
},
"proxies": ["*"]
},
}
const fetchUserEffect = createHttpEffect('/api/now/table/sys_user?sysparm_limit=1', {
method: 'GET',
successActionType: USER_FETCH_SUCCESS,
errorActionType: USER_FETCH_ERROR
});
Solved! Go to Solution.
- Labels:
-
Now Experience UI Framework
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2020 02:54 PM
Hey royjustus!
I just successfully did a GET call from my now-cli project after hours and hours of pain.
What I have come to realize is that now-cli completely ignores the now-cli.json file and anything you do in it except if you change your port, then it gets confused.
What I did to solve the problem. Is that I had to add my instance to the api request, AS WELL AS adding cors anywhere from heroku to get around cors errors.
I ALSO directly added my authorization into the header in the request, as again, the now-cli ignores the .json file. Atleast when in develop mode.
const fetchUserEffect = createHttpEffect(
"https://cors-anywhere.herokuapp.com/https://dev11111.service-now.com/api/now/table/sys_user?sysparm_limit=10",
{
method: "GET",
successActionType: "USER_FETCH_SUCCESS",
errorActionType: "USER_FETCH_ERROR",
batch: false,
headers: {
Authorization: "Basic bmljZXVzZXJuYW1laGVyZ3dvcmRoZXJl=",
},
}
);
This went straight through and was accepted.
instance id and auth key has been changed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2020 01:08 AM
Looks like even if you deploy it on instance, you will get error saying that 'r is undefined'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2020 04:25 PM
{
"development": {
"proxy": {
"origin": "https://dev100***service-now.com",
"headers": {
"Authorization": "Basic SGFoYSB5b3UgdGhpbmsgdGhpcyB3b3VsZCBiZSBteSByZWFsIHBhc3N3b3J"
},
"proxies": ['/amb/**', '/api/**']
},
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 08:29 AM
Why two * and not one?
Also I did try this and I'm still getting a 401 not authorized message.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 08:43 AM
Same here with both one and two *.
The key is that the proxy is re-directing the call to the service-now instance as evidence by my Fiddler captures. The gap seems to be that it does not add the appropriate authorization header based on the config which results in a 401.
We've heard from a number of folks who do have this issue, is there anyone out there that has gotten the proxy config to work locally?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2020 10:01 AM
It might be possible that your system admins have shut down endpoints for basic auth on the instance for security reasons. Chances are, they haven't done the same for the table API because they didn't know the setting exists on the instance. That could be why deploy works but local doesn't.
And also why this issue is being experienced by others. Because disabling basic auth is a common security setting to disable.