Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MicrosoftAccountAuthenticationProvider.OnAuthenticated does not have access to properties #143

Closed
chrispatrick opened this issue Nov 30, 2017 · 2 comments
Assignees
Milestone

Comments

@chrispatrick
Copy link

I'm not sure if there's a reason for this behaviour, but I'm using the MicrosoftAccountAuthenticationMiddleware and implementing a custom handler in OnAuthenticated. However, context.Properties is null at this point which means I can't maintain any custom state across the authentication process without doing something like manually creating and deleting cookies.

It appears to be a pretty simple thing in MicrosoftAccountAuthenticationHandler.cs to swap lines 124 and 126 around so that the properties are set on the context before OnAuthenticated is called.

@Tratcher Tratcher added this to the 4.0.0 milestone Nov 30, 2017
@Tratcher Tratcher self-assigned this Nov 30, 2017
@Tratcher
Copy link
Member

This looks like a typo. All of the other providers set the Properties first.

await Options.Provider.Authenticated(context);
context.Properties = properties;
return new AuthenticationTicket(context.Identity, context.Properties);

context.Properties = properties;
await Options.Provider.Authenticated(context);
return new AuthenticationTicket(context.Identity, context.Properties);

Feel free to send a PR if you get to it before I do.

chrispatrick pushed a commit to chrispatrick/AspNetKatana that referenced this issue Nov 30, 2017
@chrispatrick
Copy link
Author

Thanks. Thought it might be a typo. PR submitted.

Tratcher pushed a commit that referenced this issue Nov 30, 2017
@ghost ghost locked as resolved and limited conversation to collaborators Jan 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants