-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
@@ -103,7 +103,7 @@ public ChallengeResult(IList<string> authenticationSchemes, AuthenticationProper | |||
|
|||
logger.ChallengeResultExecuting(AuthenticationSchemes); | |||
|
|||
var authentication = context.HttpContext.Authentication; | |||
var authentication = context.HttpContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this or get rid of the variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems straightforward. Lotsa small stuff
@@ -103,7 +103,7 @@ public ForbidResult(IList<string> authenticationSchemes, AuthenticationPropertie | |||
|
|||
logger.ForbidResultExecuting(AuthenticationSchemes); | |||
|
|||
var authentication = context.HttpContext.Authentication; | |||
var authentication = context.HttpContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this or get rid of the variable
@@ -114,7 +114,8 @@ public ForbidResult(IList<string> authenticationSchemes, AuthenticationPropertie | |||
} | |||
else | |||
{ | |||
await authentication.ForbidAsync(Properties); | |||
// TODO: switch to use sugar in: https://github.com/aspnet/HttpAbstractions/pull/815 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No TODOs in code
@@ -21,6 +21,7 @@ Microsoft.AspNetCore.Mvc.RouteAttribute</Description> | |||
<ItemGroup> | |||
<ProjectReference Include="..\Microsoft.AspNetCore.Mvc.Abstractions\Microsoft.AspNetCore.Mvc.Abstractions.csproj" /> | |||
|
|||
<PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="$(AspNetCoreVersion)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right package? is there an abstractions package or something less implementationey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I can switch this to abstractions, but this does pose the question whether AddMVC should be calling AddAuthenticationCore which does live here, otherwise the core services will be missing if no auth was added (maybe ok?)
@@ -88,7 +88,7 @@ public SignInResult(string authenticationScheme, ClaimsPrincipal principal, Auth | |||
|
|||
logger.SignInResultExecuting(AuthenticationScheme, Principal); | |||
|
|||
var authentication = context.HttpContext.Authentication; | |||
var authentication = context.HttpContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
@@ -106,7 +106,7 @@ public SignOutResult(IList<string> authenticationSchemes, AuthenticationProperti | |||
|
|||
logger.SignOutResultExecuting(AuthenticationSchemes); | |||
|
|||
var authentication = context.HttpContext.Authentication; | |||
var authentication = context.HttpContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename
@@ -11,7 +11,7 @@ | |||
<ProjectReference Include="..\..\..\src\Microsoft.AspNetCore.Mvc.Formatters.Xml\Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj" /> | |||
<ProjectReference Include="..\Microsoft.AspNetCore.Mvc.TestConfiguration\Microsoft.AspNetCore.Mvc.TestConfiguration.csproj" /> | |||
|
|||
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="$(AspNetCoreVersion)" /> | |||
<ProjectReference Include="..\..\..\..\Security\src\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you can ignore this, security and MVC will go in in the same push party, and I won't merge this file
return Task.FromResult(AuthenticateResult.Success(new AuthenticationTicket(principal, | ||
new AuthenticationProperties(), Options.AuthenticationScheme))); | ||
new AuthenticationProperties(), Scheme.Name))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test still testing something meaningful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, its basically a Mock auth scheme for the functional auth filters test, so somewhat meaningful :)
This method needs to register the authorization services. If that means MVC Core has to depend on Auth Core, then so be it. Other than that changes look good 👍 |
Ok, added Core back to deps, and call AddAuthenticationCore next to AddAuthorization, will merge these changes in as part of the mega security PR push sometime next week |
No description provided.