我只有很少的ASP.net应用程序(MVC,VB,Web表单),我的任务是为单点登录实现ASP.net Identity。 我创建了一个单独的MVC应用程序,用于使用ASP.net Identity和owin登录,该应用程序将在site1.domain.com上运行。 现在,我需要在子域(site2.domain.com,site3.domain.com)上链接asp.net应用程序,以使用site1.domain.com进行登录。 我不想使用表单身份验证。
看了很多文章之后, 1.我已经使用IIS生成了机器密钥验证密钥等, 2.我已经在站点上安装了与单点登录相同版本的Asp.net Identity和Owin nuget软件包。
有人可以建议我下一步如何链接应用程序以进行身份验证(不是表单身份验证)。
感谢您对此的帮助。
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
// Enables the application to validate the security stamp when the user logs in.
// This is a security feature which is used when you change a password or add an external login to your account.
OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
validateInterval: TimeSpan.FromMinutes(30),
regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
},
CookieName = "CompanyUserCookie",
CookieDomain = ".company.com"
});
<machineKey validationKey="9957DA74A4394AC24C2886100A6404453EFE6D3625C7"
decryptionKey="665DBB84F65F9C319D70D"
validation="HMACSHA256" decryption="AES" />