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;
}