在AspnetCore上重用的Aspidentity 2.2(框架4.x) [英] Aspidentity 2.2 (framework 4.x) reused on AspnetCore AspIdentity

查看:78
本文介绍了在AspnetCore上重用的Aspidentity 2.2(框架4.x)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现有的:aspnet webapp和dB,使用aspidentity对控制器进行[授权]

Existing : aspnet webapp and dB, using aspidentity to [Authorize] on controllers

新功能:AspnetCore应用程序,如何使用旧的aspidentity数据库进行授权?

New: AspnetCore app, how to use the 'old' aspidentity DB to Authorize?

推荐答案

AspNet解决方案:

AspNet solution:


  1. 数据库更新: https://github.com/CK159/ CoreXplore / tree / master / Db / Migrations / Identity2Core

为新列添加迁移。

AspNetCore解决方案:

AspNetCore solution:


  1. 配置aspnetcore PasswordHasher在兼容模式下使用V2选项。 V3登录AspNetCore解决方案,用户无法登录AspNet解决方案:通过 services.Configure< PasswordHasherOptions>(o => o.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2);

  2. 连接字符串指向现有数据库

  3. 与在Azure上退出WebApp部署在同一WebApp主机中,这样​​它将共享同一台机器密钥(不能完全确定是否有必要)。

这篇关于在AspnetCore上重用的Aspidentity 2.2(框架4.x)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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