How to secure AJAX call to my controllers in an MVC 5 website with authentication?

Posted on 2014-08-14
Last Modified: 2014-08-22
I am building a MVC 5 website with authentication. I will decorate my controllers with the [Authorize] tags.  I wanted to incorporate KnockOutJs with my grid so my question is "How will KnockOut interact with the secured controllers?". Is it possible to pass the cookie with the AJAX calls?
Question by:matthew phung
    LVL 74

    Accepted Solution

    Knockout won't interact with your controllers...JQuery--if you're also using that--will. Knockout's purpose in life is to keep your UI fresh with changes to the underlying data (on the client side). If you use JQuery's AJAX functionality, then it should send cookies also--provided the URL you are calling is on the same domain as the main page.

    Author Comment

    by:matthew phung
    ok.. I'm using jQuery and just want to make sure that the authentication cookie get sent back to the server. Thank you

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now