locked
considering ways to connect ajax call to server RRS feed

  • Question

  • User-1312778766 posted

    hello.

    asp.net.4.5 web-form, application.

    using the built in membership provider form authentication (without SSL).
    after authentication success the user redirect to a aspx page that run Angular (javascript app).

    is it will be less secure if i will post ajax to that same aspx page rather than using web api?

    having the benefit of:
    same origin policy,
    could check the referer,
    on top of having that page with all user credentials.

    </div>

    Wednesday, July 8, 2015 3:05 PM

Answers

  • User753101303 posted

    Hi,

    Basically it should make no difference (it is still the same origin and you can use the same authentication etc...).

    Decide first on what makes sense from a design point of view:
    - if this is an API that makes sense only for this page you could use a page method and if could be used from multiple pages it would make sense to expose this as a general API

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2015 9:57 AM

All replies

  • User753101303 posted

    Hi,

    Basically it should make no difference (it is still the same origin and you can use the same authentication etc...).

    Decide first on what makes sense from a design point of view:
    - if this is an API that makes sense only for this page you could use a page method and if could be used from multiple pages it would make sense to expose this as a general API

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, July 9, 2015 9:57 AM
  • User-1312778766 posted

    thanks.

    Thursday, July 9, 2015 10:25 AM