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

Where can I find WindowsImpersonationContext in .net core 3.x? #35389

Closed
wstaelens opened this issue Apr 24, 2020 · 4 comments
Closed

Where can I find WindowsImpersonationContext in .net core 3.x? #35389

wstaelens opened this issue Apr 24, 2020 · 4 comments
Labels
area-System.Security question Answer questions and provide assistance, not an issue with source code or documentation.
Milestone

Comments

@wstaelens
Copy link

I'm working on a project and I need to use WindowsImpersonationContext.
I have .net core 3.1 using Windows Desktop (WPF + GDI) features

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <UseWPF>true</UseWPF>
    <UseWindowsForms>true</UseWindowsForms>
  </PropertyGroup>

so I'm bound to windows, but can't find this WindowsImpersonationContext. Which nuget should I add?

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Apr 24, 2020
@jkotas
Copy link
Member

jkotas commented Apr 24, 2020

WindowsImpersonationContext is not in .NET Core. It was an intentional decision since it has number of security problems. The discussion about this is at #20647 (comment)

@jkotas
Copy link
Member

jkotas commented Apr 24, 2020

The recommendation is to change the code to use WindowsIdentity.RunImpersonated method.

@ghost
Copy link

ghost commented Apr 24, 2020

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq
Notify danmosemsft if you want to be subscribed.

@jkotas jkotas added the question Answer questions and provide assistance, not an issue with source code or documentation. label Apr 24, 2020
@bartonjs bartonjs removed the untriaged New issue has not been triaged by the area owner label Apr 24, 2020
@bartonjs bartonjs added this to the Future milestone Apr 24, 2020
@jkotas jkotas closed this as completed Apr 25, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security question Answer questions and provide assistance, not an issue with source code or documentation.
Projects
None yet
Development

No branches or pull requests

4 participants