kalimuthu
kalimuthu

Reputation: 139

Authentication and Authorization in single page applications

How to Authenticate and Authorations based on the user roles in a single page applications in mvc3 ? can any one give some best solutions ?

Upvotes: 0

Views: 1208

Answers (1)

Wiktor Zychla
Wiktor Zychla

Reputation: 48314

There is no difference between single and multi page applications in terms of authentication/authorization. If you are using Forms Authentication, Windows Authentication or yet another method of authentication/authorization, you still use it when moving to single page application architecture.

In both cases, an application sends requests to the server to access resources. Multi page applications request pages. Single page applications request data from web services. Resources that need to be protected are protected, usually using built-in mechanisms.

Suppose for example that your single page application calls webapi services at the server side to get json data, where requests are made with jquery/ajax. At the server side you guard service methods with the Authorize attribute or even validate request parameters and authorize requests depending on the result of specific validations.

Upvotes: 1

Related Questions