Tuesday, 18 February 2014

Authentication error

Problem Details:- We are getting the following error while replying a Web/HTTP script:

Error -26547: Authentication required, please use web_set_user, e.g. web_set_user("domain\\user", "password", "host:port");, Snapshot Info [MSH 0 5] [MsgId: MERR-26547]
Action.c(88): Error -26630: HTTP Status-Code=401 (Authorization Required) for "https://getsg.service-now.com/xmlhttp.do"

It seems to be due to an extra authentication that we need to have in the script, we are waiting on requestor to provide details to generate the web_set_user line within our script, is there a way for us to make our script work besides with web_set_user instruction? a setting in the script perhaps.

Problem Solution:-  I was able to check your case description and we need to verify if the application you are working with is using Microsoft Distributed Password Authentication (DPA).

The error message you provide is similar with an internal article related with DPA, to determinate if DPA is being used in the generation log of the script look at the header in the server response to the initial GET. You should see something like the example below:

HTTP/1.1 401 Access Denied\r\n
Server: Microsoft-IIS/5.0\r\n
Date: Fri, 15 Jan 2010 11:07:04 GMT\r\n
WWW-Authenticate: DPA\r\n
Content-Type: text/html\r\n
Cache-Control: proxy-revalidate\r\n
Content-length: 616\r\n
Proxy-Connection: Keep-Alive\r\n
Connection: Keep-Alive\r\n
Proxy-support: Session-based-authentication\r\n

Now according with this article DPA is not supported by LoadRunner because of this you are getting the error message.

There’s a small workaround you can try where you have to enable WinInet Mode during reply but if this does not work there’s no much LR can do. In order to enable WinInet mode go to Run-Time Settings > Internet Protocol > Preferences, enable the option WinInet Reply instead of Sockets (Windows Only)

comment: So we can confirm that DPA is not implemented in the application.

In that case you need to check if the application is using cross-reference (basically a second page) to other URL that may require authentication, if so verify this other URL is part of the business process if is not part you can try to remove it.

Now the other option will be recording the entire script using WinInet during recording process. Under Recording Options > Network > Port Mapping, select WinInet Level Data.

If this does not work then you will have to use web_set_user()