Highlighted
Absent Member.
Absent Member.
6087 views

Error -26547: Authentication required, please use "web_set_user"

Jump to solution

Hi,  

Im currently doing web perf testing and encountering the errors below:

Error -26547: Authentication required, please use "web_set_user", e.g. web_set_user("domain\\user", "password", "host:port");

Error -26630: HTTP Status-Code=401 (Unauthorized) for "some website here"

I have tried applying the web_set_user functionality but still getting the same error and warnings.  

Also, I have this warning comment inside my code. Hoping this will help you give me an adivse.

"/*Possible OAUTH authorization was detected. It is recommended to correlate the authorization parameters.*/"

I have checked some related forum posts but haven't found a way to completely solve my issue.

LR Version: 12.53

Protocol: HTTP/HTML

Screenshot of the error: Attached

error_evidence.jpg

 

 

Snippet of the code that causes the trouble:

web_custom_request("token_2", 
        "URL=http://somewebsitehere/oauth/token?_=somenumbersitehere", 
        "Method=POST", 
        "TargetFrame=", 
        "Resource=0", 
        "RecContentType=application/json", 
        "Referer=http://*****/login.html?", 
        "Snapshot=t123.inf", 
        "Mode=HTML", 
        "EncType=application/json", 
        "Body={\"username\":\"*****@domain.com\",\"password\":\"*****\",\"grant_type\":\"password\",\"client_id\":\"*****\",\"client_secret\":\"a\"}", 
        LAST);

---

    web_custom_request("list", 
        "URL=http://somewebsitehere/services/profiles/profiles/list?_=somenumbersitehere", 
        "Method=OPTIONS", 
        "TargetFrame=", 
        "Resource=0", 
        "Referer=", 
        "Snapshot=t162.inf", 
        "Mode=HTML", 
        EXTRARES, 
        "Url=http://somewebsitehere/profile?_=somenumberhere", "Referer=http://somewebsitehere/?mode=view&_=somenumberhere", ENDITEM, 
        "Url=http://somewebsitehere?_=somenumberhere", "Referer=http://somewebsitehere?_=somenumberhere", ENDITEM, 
        "Url=http://somewebsitehere?_=somenumberhere", "Referer=http://somewebsitehere/?type=other", ENDITEM, 
        LAST);

 

 



Tags (2)
0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

Hi, All.

This is now resolved.

I've used fiddler to find the dynamic value of auth_token and correlated its value. And added web_add_header in every submit_data (the one with METHOD=POST) . 

This has been solved via:

- Correlating the auth_token dynamic value

- Using web_add_header

- Using web_set_user

 

Cheers

View solution in original post

0 Likes
6 Replies
Highlighted
Super Contributor.
Super Contributor.

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

Hi Anamada,

have you tried some changes in run time settings (i.e. use WinInet API)?

What exactly is the environment you are scripting (SSO, Kerberos, ...)?

Regards, Christoph

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

I have tried several workarounds listed below:

- Recorded script in web http/html and URL mode.

- Added web_Set_user(user id, pwd, host)

- Added wen_add_header

- Used web_Set_sockets option

- Tried replay in winlnet replay instead of sockets

- Tried playing around withthe RT settings

I was advised by the dev that they are using the same LDAP authentication. 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

Hi,

You have mentioned that you have " Added web_add_header" and Added web_Set_user(user id, pwd, host).

Have you compared both the record and replay "request" sent in raw data(Snapshot View)?

I suspect the suthentication headers are missing in the request. Hence, returned as 401 unauthoorized error message.

Please do post  both record and replay request sent from snapshot view(Raw Data).

Regards,

Raghul M

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

Hi, All.

This is now resolved.

I've used fiddler to find the dynamic value of auth_token and correlated its value. And added web_add_header in every submit_data (the one with METHOD=POST) . 

This has been solved via:

- Correlating the auth_token dynamic value

- Using web_add_header

- Using web_set_user

 

Cheers

View solution in original post

0 Likes
Highlighted
Visitor.

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

Please, can you provide details of how you accomplished the steps highlighted in your comment; for example, can you provide a sample code of how to implement

- Correlating the auth_token dynamic value in the load runner environment.

and also for 

- Using web_add_header

- Using web_set_user

Thank you.

 

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: Error -26547: Authentication required, please use "web_set_user"

Jump to solution

You are asking for the very basics of correlation. Please search the internet for tutorials on this subject.

You might have a look to e.g https://www.youtube.com/watch?v=gtDqb_glLqQ at 41:00 they start taking about correlation.

Signature:
Reward community members who take time to respond and help.
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.