本文介绍了如何在Web Api Owin Identity上使用我自己的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我已经创建了示例web api基于令牌的身份验证。在此我想使用OWIN中间件和承载令牌进行身份验证。但是我已经有了一个数据库,并且不想使用Microsoft的新Identity框架作为它自动生成的大多数表和列,我根本不需要。任何人都可以指出我如何应用这种类型的身份验证的正确方向,而无需使用Microsoft身份框架?



所以请任何人建议我如何使用自己的DataBase表来实现这个目标。



提前致谢,

Mohan G

Hi Friends,

I have created sample web api Token Based Authentication. In this i Want to authenticate using OWIN middleware and bearer tokens. However I already have a database and don't want to use Microsoft's new Identity framework as the majority of tables and columns that it auto generates I simply don't need. Can anyone point me in the right direction of how to apply this type of authentication without having to use the Microsoft Identity framework?.

So please can any one suggest me how can i use my own DataBase tables to achive this.

Thanks in advance,
Mohan G

推荐答案

<pre lang="c#">IdentityUser user = await _repo.FindUser(context.UserName, context.Password);

而不是这一行你需要使用你的数据库逻辑..



[]

instead of this line you need to use your DataBase Logic..

http://www.saifikram.com/2014/06/token-based-authentication-using-asp-net-web-api-2-with-owin[^]


这篇关于如何在Web Api Owin Identity上使用我自己的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 17:27