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

support WindowsPrincipal in HttpListenerWebSocketContext #65746

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

pedrobsaila
Copy link
Contributor

Fixes #63738

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Feb 22, 2022
@ghost
Copy link

ghost commented Feb 22, 2022

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #63738

Author: pedrobsaila
Assignees: -
Labels:

area-System.Net

Milestone: -

@@ -101,7 +101,15 @@ public class HttpListenerWebSocketContext : WebSocketContext
else
{
// AuthenticationSchemes.Digest, AuthenticationSchemes.Negotiate, AuthenticationSchemes.NTLM.
#if (WINDOWS)
if (user.Identity is WindowsIdentity windowsIdentity)
Copy link
Member

Choose a reason for hiding this comment

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

Don't we know user.Identity is a WindowsIdentity here? The .NET Framework implementation just casts:
https://referencesource.microsoft.com/#System/net/System/Net/WebSockets/HttpListenerWebSocketContext.cs,149

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM. test failures seems unrelated.

@MihaZupan
Copy link
Member

Failures unrelated: #66672 #2271

@MihaZupan MihaZupan merged commit 16e263a into dotnet:main Mar 15, 2022
@pedrobsaila pedrobsaila deleted the 63738 branch March 15, 2022 20:19
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
* support WindowsPrincipal in HttpListenerWebSocketContext

* user Identity is known as instance of WindowsIdentity

* use TARGET_WINDOWS preprocessor
@karelz karelz added this to the 7.0.0 milestone Apr 8, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Net community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpListenerContext.AcceptWebSocketAsync unsupported for IWindowsPrincipal in .NET Core 3.1
5 participants