的ASP.NET Web API,简单/自定义成员资格,AngularJS和Petapoco [英] ASP.NET Web API, Simple/Custom Membership, AngularJS, and Petapoco

查看:250
本文介绍了的ASP.NET Web API,简单/自定义成员资格,AngularJS和Petapoco的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个简单的AngularJS Web应用程序。

I'm working on a simple AngularJS Web application.

我想用登录名和密码只有一次完成认证。

I want to implement authentication using login and password only once.

所有的Web API安全的例子我能找到的是为每一个请求发送用户名和密码,并利用实体框架。

All the Web API security examples I could find are sending username and password for every single request and makes use of Entity Framework.

我想有一个登录页面,一旦验证用户,让他们使用的应用程序。

I want to have a login page, authenticate the user once and let them use the app.

我想用PetaPoco,因为我发现实体框架是太复杂(我将不得不学习LINQ)。但simpleMembership提供商例子使用实体框架)。即使是MVC4互联网应用程序使用实体框架。

I want to use PetaPoco since i find Entity Framework to be too complicated (i will have to learn Linq). But the simpleMembership provider examples uses Entity Framework). Even the MVC4 internet application uses Entity Framework.

任何想法/样品?

推荐答案

我们一直在使用相同的堆栈,你在你的问题提到。 ASP.Net MVC,网络API,PetaPoco。我们使用 ASP.Net通用提供者,其默认的配置

We have been using the same stack as you have mentioned in your question. ASP.Net MVC, Web API, PetaPoco. We use the ASP.Net Universal Provider with its default configuration.

一旦用户的ASP.Net MVC应用程序中的身份验证,请求的WebAPI不需要传入任何特定的凭证。由于底层框架是ASP.Net的FormAuthenticationModule需要身份验证的一部分无缝的照顾。

Once the user is authenticated within the ASP.Net MVC application, request to webapi do not require passing in any specific credentials. Since the underlying framework is ASP.Net the FormAuthenticationModule takes care of Authentication part seamlessly.

关于你问题EF。因为你不能与EF互动,我不认为这是一个问题。图书馆是和你只是一个库的消费者。这可能会增加依赖于EF但是,这并不影响你实现,您可以自由使用任何你想要的数据访问库。 EF的使用率一直在抽象的。

Regarding you problem with EF. I don't consider that a problem because you are not interacting with EF. The library is and you are just a consumer of the library. It may add dependency on EF but that does not effect you implementation, you are free to use any data access library you want. The usage of EF has been abstract.

这篇关于的ASP.NET Web API,简单/自定义成员资格,AngularJS和Petapoco的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆