Highlighted
Absent Member.. Absent Member..
Absent Member..
276 views

Trying to write a REST service test ..getting authentication error

Hi,

I am trying to write a REST service and followed all the guides but i am getting response back as "401 Unauthorized" error. I did put the username and password in the authentication properties but it still doesnt work.

Thanks

 

0 Likes
8 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Trying to write a REST service test ..getting authentication error

Hi 

This may be an indication that furhter authentication seetings are needed for example a certificate. You may need to find out from the REST service developer or adminsitrator what kind of authentication is required and what security items (headers or client certificates)  must be configured with the REST request.

For configuring a Client Certificate use the general tab and specify by path and file name of from Use Windows store certificate.

Hope this helps.

 

 

 

 

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Trying to write a REST service test ..getting authentication error

Thanks. I tried using SOAP UI and using NTLM authentication , it worked. so how do i implement the same in UFT?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Trying to write a REST service test ..getting authentication error

Hi 

Have you tried using the DOMAIN\user format in the user name field?

Example:
    User name: myDomain\myUser
    Password: myPassword

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Trying to write a REST service test ..getting authentication error

tried it. still did not work. The header still shows as Basic authentication . In SOAP UI , when it was basic , it didnt work but when i changed it to NTLM , it worked.  Anyway, i can change that in UFT?

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Trying to write a REST service test ..getting authentication error

Hello,

 

Could you kindly check this knowledge base article to see if it is helpful?

https://softwaresupport.hp.com/group/softwaresupport/search-result/-/facetsearch/document/KM00587049

 

Regards,

 

Jackie Yang

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Trying to write a REST service test ..getting authentication error

Thanks. but when i click on the link, i get a message "You dont have permission"

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: Trying to write a REST service test ..getting authentication error

HI

Option avobe suggests adding some custom code to add authorization header, however that is intended for Soap reuqest for it may not apply to REST. 

Could you also try setting the Use preemptive authentication value to true. 

Taht setting is right below the User and Password fields and enables you to send authentication for your Web service call without waiting for the authentication challenge from the Web service/server.

hope that helps.

regards.

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Trying to write a REST service test ..getting authentication error

Tried that. Still did not work. Still getting error

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.