Does jQuery $ .ajax () function correctly handle ASP.NET authentication?

I have a web application protected by ASP.NET Forms Authentication. The site uses the jQuery $ .ajax () function to call the web service in the same application.

Viewing the .asmx web service invokes forms authentication, and I once authenticated and made a call to $ .ajax () on the server. I also see an ASP.NET session cookie and generate an auth cookie, which is sent back to the server in Fiddler.

So ... although everything seems to be all right, I would like to calm down that really the web service will be protected by the authentication of ASP.NET forms when called from any of the pages in the web application using $ .ajax ().

+3
source share
3 answers

, ajax GET/POST - , . , , - , , , , .

, , , , , Ajax. .

+3

, , , . $ajax PageMethods WCF ASP.Net, .

+1

It will be protected, but watch out for what happens when your auth expires and auth forms are redirected back to the login URL with a 302 FOUND response.

+1
source

Source: https://habr.com/ru/post/1699697/


All Articles