OpenIdConnect 认证启用 HTTPS 回调 RedirectUri 不生效问(4)

private string CurrentUri
        {
           
get
            {
               
return Request.Scheme +
                      Uri.SchemeDelimiter
+
                      Request.Host
+
                      Request.PathBase
+
                      Request.Path
+
                      Request.QueryString;
            }
        }

由于我们使用的负载时在LB层做的,所以默认获得的地址是 HTTP的,那么为什么 Properties.RedirectUri 获取是哪里的数据呢 ?

private readonly IOwinContext _context;
...

       
/// <summary>
        /// Find response challenge details for a specific authentication middleware
       
/// </summary>
        /// <param>The authentication type to look for</param>
        /// <param>The authentication mode the middleware is running under</param>
        /// <returns>The information instructing the middleware how it should behave</returns>
        public AuthenticationResponseChallenge LookupChallenge(string authenticationType, AuthenticationMode authenticationMode)
        {
           
if (authenticationType == null)
            {
               
throw new ArgumentNullException("authenticationType");
            }

            AuthenticationResponseChallenge challenge
= _context.Authentication.AuthenticationResponseChallenge;
           
bool challengeHasAuthenticationTypes = challenge != null && challenge.AuthenticationTypes != null && challenge.AuthenticationTypes.Length != 0;
           
if (challengeHasAuthenticationTypes == false)
            {
               
return authenticationMode == AuthenticationMode.Active ? (challenge ?? new AuthenticationResponseChallenge(null, null)) : null;
            }
           
foreach (var challengeType in challenge.AuthenticationTypes)
            {
               
if (string.Equals(challengeType, authenticationType, StringComparison.Ordinal))
                {
                   
return challenge;
                }
            }
           
return null;
        }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7b91b1bdf1bdd009dcd8ec23be92c1d1.html