2016-10-03 49 views
2

我想根據現有數據庫對用戶進行身份驗證。我發現我需要實現IUserStore。我試圖創建自定義用戶實現IUser,我可以找到IUser是在Microsoft.AspNet.Identity程序集。在asp.net核心中是否有等價的接口?在asp.net核心中的IUser <TKey>

任何幫助表示讚賞。

感謝,

+0

有[ASP.NET核心身份(https://docs.asp.net/en/latest/security/authentication/identity.html) – qbik

+1

@qbik這是使用EntityFramework。在那裏提供的代碼使用Microsoft.AspNetCore.EntityFrameworkCore程序集中的ApplicationUser。我試圖實現沒有entityframework依賴性的身份驗證。 – Yousuf

回答

0

我剛剛被谷歌搜索一樣,我發現這個封閉問題在GitHub上https://github.com/aspnet/Identity/issues/948

從似乎接口不存在的意見,但我們還是要在我們的UserStore上提供方法......聽起來有點令我困惑。

我還發現https://docs.microsoft.com/en-us/aspnet/core/security/authentication/cookie其中描述了沒有ASP.NET Core Identity的cookie中間件。

這些也是良好的閱讀https://andrewlock.net/introduction-to-authentication-with-asp-net-core/https://andrewlock.net/exploring-the-cookieauthenticationmiddleware-in-asp-net-core/