Skip to content

Create WindowsPrincipal when cloning WindowsIdentity for SignalR #19337

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

Merged
merged 3 commits into from
Feb 26, 2020

Conversation

BrennanConroy
Copy link
Member

Fixes #18560

@BrennanConroy BrennanConroy added the area-signalr Includes: SignalR clients and servers label Feb 25, 2020
}
else
{
newContext.User = new ClaimsPrincipal();
Copy link
Member

Choose a reason for hiding this comment

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

Nit, to get rid of skipFirstIdentity

Suggested change
newContext.User = new ClaimsPrincipal();
newContext.User = new ClaimsPrincipal(windowsIdentity.Clone());

Copy link
Member Author

Choose a reason for hiding this comment

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

Think I have to keep it as is, because I still need to skip somehow when copying the rest of the identities.

Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't you just always skip? You could do something like oldContext.User.Identities.Skip(1), right?

Copy link
Member Author

Choose a reason for hiding this comment

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

That allocates I believe

@analogrelay analogrelay added this to the 5.0.0-preview2 milestone Feb 26, 2020
@bmoteria
Copy link

@anurse I noticed this PR is added to 5.0.0-preview2 milestone. Can something this small be shipped earlier than that, please? Thank you. 🙂

@analogrelay
Copy link
Contributor

@bmoteria Unfortunately no, the preview1 branch is closed to new changes at this time.

@BrennanConroy BrennanConroy merged commit 1ea10f6 into master Feb 26, 2020
@BrennanConroy BrennanConroy deleted the brecon/windows branch February 26, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows Authentication - ((ClaimsPrincipal)User).IsInRole
4 participants