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

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

问题描述

现有:aspnet webapp和dB,使用aspidentity在控制器上[授权]

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

新:AspnetCore 应用,如何使用旧"aspidentity DB 进行授权?

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 选项.AspNetCore解决方案V3登录,用户无法登录AspNet解决方案:通过services.Configure(o => o.CompatibilityMode = PasswordHasherCompatibilityMode.IdentityV2);
  2. 连接字符串指向现有数据库
  3. 在与退出 Azure 上的 WebApp 相同的 WebApp主机"中部署,这样它将共享相同的机器密钥(不完全确定这是必要的).

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

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