Highlighted
David Taggart Respected Contributor.
Respected Contributor.
873 views

WebSetUserAuthBasic with WebCustomRequest?

Jump to solution

I'm setting a username and password using WebSetUserAuthBasic, but when I make a POST to a URL using WebCustomRequest requiring authentication, I get HTTP/1.1 401 Unauthorized.

Out Headers do not show Authentication Basic either, just:

POST /URL HTTP/1.1
Host: hostname.com
Connection: Keep-Alive
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent:
UA-CPU: x86

1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

RE: WebSetUserAuthBasic with WebCustomRequest?

Jump to solution

Did you specify the "URL representing protection space for basic authentication" parameter - the 3rd one of the WebSetUserAuthBasic API call in WebUrl and WebCustomRequest?
It works for me with both when I set the protection space url.
Cheers,
Thomas

4 Replies
Micro Focus Expert
Micro Focus Expert

RE: WebSetUserAuthBasic with WebCustomRequest?

Jump to solution

Hi David,
after a 401 response the request is normally repeated with the Authorization header.
Does your 401 response contain a WWW-Authenticate header field?
Cheers,
Thomas

0 Likes
David Taggart Respected Contributor.
Respected Contributor.

RE: WebSetUserAuthBasic with WebCustomRequest?

Jump to solution
Alas this is a web service I'm attempting to monitor. Authentication must be provided in the initial request. An Authentication header IS included when I'm using WebURL, but not when I'm using WebCustomRequest .
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: WebSetUserAuthBasic with WebCustomRequest?

Jump to solution

Did you specify the "URL representing protection space for basic authentication" parameter - the 3rd one of the WebSetUserAuthBasic API call in WebUrl and WebCustomRequest?
It works for me with both when I set the protection space url.
Cheers,
Thomas

David Taggart Respected Contributor.
Respected Contributor.

RE: WebSetUserAuthBasic with WebCustomRequest?

Jump to solution
That worked for me, thanks Kue!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.