React to Http Challenge changes
This commit is contained in:
parent
e03c015065
commit
f191792b96
|
|
@ -79,11 +79,11 @@ namespace Microsoft.AspNet.Server.WebListener
|
|||
{
|
||||
var authScheme = scheme.ToString();
|
||||
// Not including any auth types means it's a blanket challenge for any auth type.
|
||||
if (context.AuthenticationSchemes == null || !context.AuthenticationSchemes.Any()
|
||||
|| context.AuthenticationSchemes.Contains(authScheme, StringComparer.Ordinal))
|
||||
if (context.AuthenticationScheme == null ||
|
||||
string.Equals(context.AuthenticationScheme, authScheme, StringComparison.Ordinal))
|
||||
{
|
||||
_customChallenges |= scheme;
|
||||
context.Accept(authScheme, GetDescription(authScheme));
|
||||
context.Accept();
|
||||
}
|
||||
}
|
||||
// A challenge was issued, it overrides any pre-set auth types.
|
||||
|
|
|
|||
|
|
@ -353,7 +353,10 @@ namespace Microsoft.AspNet.Server.WebListener
|
|||
var context = new DefaultHttpContext((IFeatureCollection)env);
|
||||
Assert.NotNull(context.User);
|
||||
Assert.False(context.User.Identity.IsAuthenticated);
|
||||
context.Response.Challenge(authTypeList);
|
||||
foreach (var scheme in authTypeList)
|
||||
{
|
||||
context.Response.Challenge(scheme);
|
||||
}
|
||||
return Task.FromResult(0);
|
||||
}))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue