Gravatar for sathis.k.durairaj@accenture.com

Question by Sathis, Jul 22, 2015 12:41 PM

REST API Service 401 error

I am using .Net front REST API to get the coveo result response.

When i try to call the url from .net backend, i am getting 401 unauthorized exception. At the same time i am able to call the url(http://localhost:8080/Coveo/Rest) when i hit from browser directly.

Do i need set the credential somewhere?

Gravatar for lbergeron@coveo.com

Comment by Luc Bergeron, Jul 22, 2015 1:25 PM

If you use a web browser to test the call on the backend, it usually takes the user you are logged with to make the request.

I have a few more questions:

  • Are you using the same user account in both cases?
  • Which authentication method(s) are you using on the web site? Is anonymous authentication enabled?

Also did you try to run the browser as a different user on the backend?

Gravatar for sathis.k.durairaj@accenture.com

Comment by Sathis, Jul 22, 2015 1:36 PM

Yes, Anonymous access is enabled on the website.

Gravatar for lbergeron@coveo.com

Comment by Luc Bergeron, Jul 22, 2015 2:24 PM

Ok, and are you using the same account when testing from both places?

Are you able to connect to the Coveo search from the backend server? If yes, then try to pass the debug parameter like this:

http://frontendserver:8080/?debug=1

It will output more information regarding the user account that is performing the query. Not that this setting can be disabled on the backend to prevent users from viewing the debug information. Comparing the output from both places may help to understand what's happening.

I hope this helps.

0 Reply
Ask a question