ASP.NET标识子域路径

时间:2015-05-27 15:27:51

标签: asp.net-mvc asp.net-mvc-5

我正在尝试在我的MVC5应用程序(sub2)中读取表单身份验证cookie(来自子域(sub1))。我的Web.Config中有以下内容

<machineKey decryption="AES" validation="SHA1" validationKey="010D62DCblah blah" decryptionKey="blah blah" />
<authentication mode="Forms">
  <forms loginUrl="http://sub1.domain.us.com/Authentication/Login?site=billing" timeout="2880" name=".COOKIE" protection="All" />
</authentication>
<httpCookies domain=".domain.us.com" httpOnlyCookies="true" requireSSL="false" />

Startup.Auth.cs

app.UseCookieAuthentication(new CookieAuthenticationOptions
{
    AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
    LoginPath = new PathString("/Authentication/Login"),
    CookieDomain = ".domain.us.com",

});     

所以我的MVC5网站是:

sub2.domain.us.com

和身份验证网站是: sub1.domain.us.com

如何进入sub1.domain.us.com以执行登录?

这甚至可能吗?我在正确的轨道上吗? 现在它需要我sub2.domain.us.com/Authentication/Login而不是sub1.domain.us.com/Authentication/Login 或者如何使Startup.Auth.cs使用web.config loginUrl中的信息?

感谢

0 个答案:

没有答案