【问题标题】:IdentityServer 4 with an old WebForms site带有旧 WebForms 站点的 IdentityServer 4
【发布时间】:2017-09-29 07:18:59
【问题描述】:

我有一个旧的网络表单站点,其中有许多使用 microsoft.aspnet.identity 2.2 的关键业务用户

我们希望扩展站点,但将使用微服务类型的架构来实现此目的。我们希望启动新的 .NET 核心服务,但它们需要能够连接到这个充满用户的旧数据库。我的意思是能够共享登录信息(因此用户不需要在各种微服务中登录两次)

是建立连接到该数据库然后允许的 IdentityServer(在其自身的某个地方 - 可能托管在 AWS 中)的最佳方式:

1) 对其进行身份验证的网络表单

2) 未来的 .net core 微服务可以认证吗?

目前我们的应用程序有这个:

app.CreatePerOwinContext(ApplicationDbContext.Create);
            app.CreatePerOwinContext<ApplicationUserManager>(ApplicationUserManager.Create);
            app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);

        // Enable the application to use a cookie to store information for the signed in user
        // and to use a cookie to temporarily store information about a user logging in with a third party login provider
        // Configure the sign in cookie
        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
            LoginPath = new PathString("/Account/Login"),
            SlidingExpiration = true,
            CookieName = ".AspNet.SomeName"
        });
        // Use a cookie to temporarily store information about a user logging in with a third party login provider
        app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);h section 

【问题讨论】:

    标签: identityserver3 identityserver4


    【解决方案1】:

    我会查看 IdentityServer4.Samples 存储库。

    看起来您正在使用 OWIN,因此您可以轻松地调整 MvcHybrid 示例: https://github.com/IdentityServer/IdentityServer4.Samples/tree/release/Clients/src/MvcHybrid

    如果您不使用 OWIN,请查看 MvcManual 客户端中的 HomeController。它可以很容易地移植到 WebForms 应用程序中。

    https://github.com/IdentityServer/IdentityServer4.Samples/blob/release/Clients/src/MvcManual/Controllers/HomeController.cs

    【讨论】:

      猜你喜欢
      • 2015-04-20
      • 2020-12-16
      • 2018-02-13
      • 1970-01-01
      • 2011-07-09
      • 2011-12-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多