-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Conversation
Tagging subscribers to this area: @dotnet/ncl |
@@ -101,7 +101,15 @@ public class HttpListenerWebSocketContext : WebSocketContext | |||
else | |||
{ | |||
// AuthenticationSchemes.Digest, AuthenticationSchemes.Negotiate, AuthenticationSchemes.NTLM. | |||
#if (WINDOWS) | |||
if (user.Identity is WindowsIdentity windowsIdentity) |
There was a problem hiding this comment.
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
src/libraries/System.Net.HttpListener/src/System/Net/WebSockets/HttpListenerWebSocketContext.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
* support WindowsPrincipal in HttpListenerWebSocketContext * user Identity is known as instance of WindowsIdentity * use TARGET_WINDOWS preprocessor
Fixes #63738