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

Split SIgnIn/SignOut #1267

Closed
wants to merge 1 commit into from
Closed

Split SIgnIn/SignOut #1267

wants to merge 1 commit into from

Conversation

HaoK
Copy link
Member

@HaoK HaoK commented Jun 16, 2017

@Tratcher

Reacts to aspnet/HttpAbstractions#873

I'll merge this into the events PR, but easier to review these seperately first

@dnfclas
Copy link

dnfclas commented Jun 16, 2017

@HaoK,
Thanks for having already signed the Contribution License Agreement. Your agreement was validated by .NET Foundation. We will now review your pull request.
Thanks,
.NET Foundation Pull Request Bot


properties = properties ?? new AuthenticationProperties();
await HandleSignInAsync(user, properties);
Logger.SignedIn(Scheme.Name);
Copy link
Contributor

Choose a reason for hiding this comment

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

So we must now do that in EVERY handler? What a bummer 👎

Copy link
Member Author

Choose a reason for hiding this comment

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

You actually have a handler that implements sign in?

Copy link
Contributor

Choose a reason for hiding this comment

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

ASOS does (exactly like OAuthAuthorizationServerMiddleware used to).

We use that for both the authorization and token endpoints: http://kevinchalet.com/2017/01/30/implementing-simple-token-authentication-in-aspnet-core-with-openiddict/

Copy link
Member Author

Choose a reason for hiding this comment

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

So yeah if you want to log that you signed in, you need to log it yourself (and granted the logging extensions code is ridiculously gross)

Copy link
Member Author

Choose a reason for hiding this comment

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

But I imagine you can just add a Logger.Log at the top of your method is the only change for you, and implement the interface method directly instead of HandleSignIn

Copy link
Contributor

Choose a reason for hiding this comment

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

At least, do we get a sensible advantage if we split IAuthenticationHandler? 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

SignIn/SignOut default will be more likely to be correct in applications with only a single cookie configured So OIDC + Cookie won't need to specify DefaultSignInScheme anymore, well once we actually change RemoteAuthenticationHandler to stop requiring SignInScheme now that it will work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Heh, pretty sure I said "advantage"... making the default scheme selection more magical than it is already is not what I'd call an advantage.

I can already hear my users say "oh, my cookies+Facebook app worked fine before I added OpenIddict and now, I have an exception"... 😢

@HaoK
Copy link
Member Author

HaoK commented Jun 20, 2017

Rolled into #1266

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