IBM Support

GetHTTP function return 401, Unauthorized for correct username and password

Troubleshooting


Problem

The GetHTTP function fails with a HTTP 401 authorization error even though the credentials are correctly set in the policy. Since the GetHTTP function in Netcool/Impact only sends authorization credentials on request, the endpoint may never receive the credentials.

The GetHTTP function will attempt to make an initial request to an endpoint without sending an Authorization header. If the endpoints replies with a WWW-Authenticate challenge, the request is repeated with the Authorization header.

If the endpoint does not support WWW-Authenticate challenges, then the GetHTTP function will never send the Authorization header. The HTTP request must enable preemptive authentication so that requests always include an Authorization header.




Symptom

The ResultCode reported by the GetHTTP function is 401 and the ErrorReason is Unauthorized.

The following sample policy shows how to log these values:

HTTPHost="hostname.com";
HTTPPort=443;
Protocol="https";
ChannelKey="";
FilesToSend=null; 
FormParameters=null;
Method="GET";
AuthHandlerActionTreeName=null; 

HttpProperties=NewObject();
HttpProperties.UserId="my_user_id";
HttpProperties.Password="my_good_password";
HttpProperties.TrustCertificate=true;

Path="/something?param1=true"; 

y=GetHTTP(HTTPHost, HTTPPort, Protocol, Path, ChannelKey, Method,
  AuthHandlerActionTreeName, FormParameters, FilesToSend, HeadersToSend, HttpProperties);

Log("ErrorReason: " + ErrorReason);
Log("ResultCode: " + ResultCode);

The logs have:
 
21 November 2022 15:10:32 UTC[PolicyLogger][AuvikGetAlerts][pool-4-thread-12772]Parser log: ErrorCode: Unauthorized
21 November 2022 15:10:32 UTC[PolicyLogger][AuvikGetAlerts][pool-4-thread-12772]Parser log: ResultCode: 401



Document Location

Worldwide


[{"Type":"MASTER","Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSB2GF","label":"Netcool\/Impact"},"ARM Category":[{"code":"a8m500000008ZwmAAE","label":"Impact-\u003EPolicy-\u003EFunction"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"7.1.0"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

More support for:
Netcool/Impact

Component:
Impact->Policy->Function

Software version:
7.1.0

Document number:
6840981

Modified date:
09 May 2025

UID

ibm16840981

Manage My Notification Subscriptions