【发布时间】:2020-01-23 09:29:19
【问题描述】:
我在 HAProxy 之后隐藏了一个应用程序。
存在 SSL 终止。 我的应用程序是https://myapp.domain.com,但在 HttpContext.Request 应用程序中将其识别为http://myapp.domain.com(没有 SSL,因为它在代理级别终止)。
问题是我使用 Microsoft.Owin.Security.Google 库。 当它使用 http 而不是 https 生成 redirect_uri 时。
我已经检查了 GoogleOAuth2AuthenticationHandler => ApplyResponseChallengeAsync() 方法的实现,它清楚地表明这个 redirect_uri 是从服务器端数据生成的:
string str1 = this.Request.Scheme + Uri.SchemeDelimiter + (object) this.Request.Host + (object) this.Request.PathBase;
string str2 = str1 + (object) this.Request.Path + (object) this.Request.QueryString;
string str3 = str1 + (object) this.Options.CallbackPath;
问题是我怎样才能强制这个提供者获得一个有效的 url 方案?
【问题讨论】:
标签: c# asp.net-mvc authentication oauth