Go to All Forums

[Website Monitor] The request requires user authentication.

We added a url without a user authentication to a website monitor:

ourwebsite.azurewebsites.net/api/AvailabilityCheck?code=examplecode==
 
ourwebsite = our subdomain on azurewebsites.net
examplecode = unique ID for website
 
we always get an error "the request requires user authentication". Why?

Could be the "?code=" or the "==" at the end of the url be a problem to monitor this website?
 
Please help.
Like (6) Reply
Replies (5)

Hi Pfeffer,

As you stated that you have sent the request without authentication information, the URL will return 401 status code and hence the error message is displayed.

 

If you want to treat this status as UP, kindly configure 401 as an Accepted HTTP status code as shown in the image. Otherwise, you'll have to give the necessary authentication information to make this work.

 

Please navigate to Web > for the selected monitor click on the hamburger icon (far right corner) >  choose edit > enter 401 in the field "Accepted HTTP status codes".

 

 

I hope this answers your query. If you're still facing an issue, please reply back to this same thread and we'll look into it.

 

-Rajesh

Product Developer, Site24x7

Like (0) Reply

Hi Rajesh,

thanks for you answer. The webpage returns 200 if we opening the URL via our browser. If we add the URL to Site24x7 we always get an 401. The URL contains a token for our function app so that not everybody can access it from externally.

Kind regards,

Thomas

Like (0) Reply

Hi Thomas, 

    Did you try with Authentication method? You can see in the screenshot that Rajesh had put in his comment.

-Jasper

Product Manager, Site24x7

Like (0) Reply

Hi Jasper,

there is no authentication service. It only validates the get parameter code and if it is correct, we get 200 ok back from the server. If the key is incorrect, we get 401 but if we use Site24x7 we always get 401. If we open it with the browser or using Postman we get 200 ok back. Maybe there is a problem with the equal character in the token? That is what our url looks like:

nnnnnn.azurewebsites.net/api/AvailabilityCheck?code=jeglJTIKcngPOlj4uQfOCYmWWVJ0aj88TrMJ1VAIMoezDbE2jvONcg==

PS: If you need a test site (to check it from your site), let me know. I'll then open a support request.

Kind regards,
Thomas

Like (0) Reply

Yes, Thomas. That would be easier to debug from our side. I'll update the solution here once we solve it so that others in the community would know.  

-Jasper

 

Like (0) Reply

Was this post helpful?