Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Conversation

HaoK
Copy link
Member

@HaoK HaoK commented Apr 13, 2017

No description provided.

logger.ChallengeResultExecuting(AuthenticationSchemes);

var authentication = context.HttpContext.Authentication;
var authentication = context.HttpContext;
Copy link
Member

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

Copy link
Member

@rynowak rynowak left a 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

logger.ForbidResultExecuting(AuthenticationSchemes);

var authentication = context.HttpContext.Authentication;
var authentication = context.HttpContext;
Copy link
Member

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

else
{
await authentication.ForbidAsync(Properties);
// TODO: switch to use sugar in: https://github.com/aspnet/HttpAbstractions/pull/815
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No TODOs in code

<ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Mvc.Abstractions\Microsoft.AspNetCore.Mvc.Abstractions.csproj" />

<PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="$(AspNetCoreVersion)" />
Copy link
Member

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?

Copy link
Member Author

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?)

logger.SignInResultExecuting(AuthenticationScheme, Principal);

var authentication = context.HttpContext.Authentication;
var authentication = context.HttpContext;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename

logger.SignOutResultExecuting(AuthenticationSchemes);

var authentication = context.HttpContext.Authentication;
var authentication = context.HttpContext;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename

<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" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

Copy link
Member Author

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)));
}
Copy link
Member

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?

Copy link
Member Author

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 :)

@rynowak
Copy link
Member

rynowak commented Apr 14, 2017

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 👍

@HaoK
Copy link
Member Author

HaoK commented Apr 14, 2017

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

@HaoK
Copy link
Member Author

HaoK commented Apr 20, 2017

3e8cd1e

@HaoK HaoK closed this Apr 20, 2017
@HaoK HaoK deleted the haok/auth2 branch August 7, 2017 17:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants