Skip to content

support WindowsPrincipal in HttpListenerWebSocketContext - #65746

Merged
MihaZupan merged 3 commits into
dotnet:mainfrom
pedrobsaila:63738
Mar 15, 2022
Merged

MihaZupan merged 3 commits into
dotnet:mainfrom
pedrobsaila:63738

Conversation

@pedrobsaila

Copy link
Copy Markdown
Contributor

Fixes #63738

@ghost ghost added area-System.Net community-contribution Indicates that the PR has been added by a community member labels Feb 22, 2022
@ghost

ghost commented Feb 22, 2022

Copy link
Copy Markdown

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: -

{
// AuthenticationSchemes.Digest, AuthenticationSchemes.Negotiate, AuthenticationSchemes.NTLM.
#if (WINDOWS)
if (user.Identity is WindowsIdentity windowsIdentity)

Copy link
Copy Markdown
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

@wfurt wfurt left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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