您现在的位置是:首页 > 电脑 > 

Owin CookieDomain IIS7和SSL(Owin CookieDomain IIS7 and SSL)

2025-07-18 19:27:00
Owin CookieDomain IIS7和SSL(Owin CookieDomain IIS7 and SSL) 我在设置应用程序之间的SSO时遇到问题,在创建Cookie的应用程序中,我有: app.UseCookieAuthentication(new CookieAuthenticationOpti {
Owin CookieDomain IIS7和SSL(Owin CookieDomain IIS7 and SSL)

我在设置应用程序之间的SSO时遇到问题,在创建Cookie的应用程序中,我有:

app.UseCookieAuthentication(new CookieAuthenticationOpti { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), // LogoutPath = new PathString("/Account/Logout"), // ExpireTimeSpan = TimeSpan.FromDays(1), Cookieame = "mycookie", CookieDomain = ".", });

当在本地测试时,我会得到我期望的结果

Cookie =名称:mycookie,域名:.

但是,当我去我们的测试环境时,我会得到

Cookie =名称:mycookie,域名:oauth.

由于cookie具有域的根,所以它不适用于其他应用程序。 我已经做了我能想到的所有事情,但它似乎并不想使用配置中指定的域。


更新:在使用SSL时从IIS7环境托管时出现这是一个问题。 当不在IIS7中使用SSL或者在使用IIS8部署到我们的UAT环境时,它会按预期工作。

使用SSL时,它也不能正确重定向。 我认为这个问题也是相关的。

当我点击http://site.时,我被重定向到

http://auth./account/login?returnUrl=site.

如预期的那样,但是如果启用SSL,我将重定向到

https:// site. /account/login?returnurl=site.

I am having a problem with setting up SSO between our apps, In the application that creates the cookie I have:

app.UseCookieAuthentication(new CookieAuthenticationOpti { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), // LogoutPath = new PathString("/Account/Logout"), // ExpireTimeSpan = TimeSpan.FromDays(1), Cookieame = "mycookie", CookieDomain = ".", });

When testing this locally I get the result I expect

Cookie = ame: mycookie, Domain: .

However when I go to our test environment I get

Cookie = ame: mycookie, Domain: oauth.

Since the cookie has the root of the domain it does not work in the other applicati. I have done everything I can think of but it just does not seem to want to use the domain specified in the configuration.


Update: It appears this is a problem when hosting from an IIS7 environment when using SSL. When not using SSL in IIS7 or when deployed to our UAT enviroment with IIS8 it works as expected.

When using SSL it is also not redirecting correctly. I think this problem is also related.

When I hit http://site. I am redirected to

http://auth./account/login?returnUrl=site.

as expected, however If SSL is enabled I am redirected to

https://site./account/login?returnurl=site.

最满意答案

所以看起来问题发生在防火墙/代理服务器后面。

So It looks like the problem is happening within a firewall/proxy those servers sit behind.

#感谢您对电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格的认可,转载请说明来源于"电脑配置推荐网 - 最新i3 i5 i7组装电脑配置单推荐报价格

本文地址:http://www.dnpztj.cn/diannao/697361.html

相关标签:无
上传时间: 2023-08-27 09:44:42
留言与评论(共有 16 条评论)
本站网友 土豆加速器
2分钟前 发表
LoginPath = new PathString("/Account/Login")
本站网友 上海世贸大厦
13分钟前 发表
当我点击http
本站网友 卢菲菲
21分钟前 发表
但它似乎并不想使用配置中指定的域
本站网友 成都电影院
5分钟前 发表
所以它不适用于其他应用程序
本站网友 苏州市万达广场
3分钟前 发表
Owin CookieDomain IIS7和SSL(Owin CookieDomain IIS7 and SSL) 我在设置应用程序之间的SSO时遇到问题
本站网友 ntldr丢失
10分钟前 发表
更新:在使用SSL时从IIS7环境托管时出现这是一个问题
本站网友 假体隆下巴价格
4分钟前 发表
Cookieame = "mycookie"
本站网友 珍宝
24分钟前 发表
我有: app.UseCookieAuthentication(new CookieAuthenticationOpti { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
本站网友 再活五百年
10分钟前 发表
但它似乎并不想使用配置中指定的域
本站网友 上睑下垂
28分钟前 发表
app.UseCookieAuthentication(new CookieAuthenticationOpti { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie
本站网友 波动
23分钟前 发表
Owin CookieDomain IIS7和SSL(Owin CookieDomain IIS7 and SSL) 我在设置应用程序之间的SSO时遇到问题
本站网友 数字电视无信号
8分钟前 发表
Cookieame = "mycookie"
本站网友 黑客入门
8分钟前 发表
however If SSL is enabled I am redirected to https
本站网友 数字防抖
2分钟前 发表
它会按预期工作
本站网友 气候变暖
20分钟前 发表
app.UseCookieAuthentication(new CookieAuthenticationOpti { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie