Questions tagged [windows-identity]

Use this tag to better reference questions about WindowsIdentity allowing to encapsulate information about Windows accounts.

The WindowsIdentity object encapsulates information about Windows accounts. You use the WindowsIdentity object if you want to make authorization decisions based on a user's Windows account information.

For example, using WindowsIdentity and WindowsPrincipal objects, you can write an application that requires all users to be currently validated by a Windows NT or Windows 2000 domain. You can also allow certain domain accounts to access your application while denying access to others.

To find more information :

204 questions
5
votes
1 answer

How to check in C# if running as local administrator

Possible Duplicate: How can I tell if my process is running As Administrator? How can I check using C# if my process is running as the local Administrator? I know how to find out if the current user is a member of the builtin Administrators…
candritzky
  • 351
  • 4
  • 11
4
votes
2 answers

Getting WindowsIdentity in my WCF Web Service

I took over code from a developer that is no longer with us. It's a WCF web service that was originally using a passed in username, but we need it to use the WindowsIdentity instead. string identity =…
Gary the Llama
  • 321
  • 1
  • 4
  • 15
4
votes
4 answers

.Net Core Impersonation not working with Process.Start

I can't seem to start a process as another user when using impersonation under .Net Core. I'm running this script in Linqpad running as User1 and trying to launch a program as User2. At first, the impersonation seems to work (the…
4
votes
0 answers

Get WindowsIdentity from ClaimsIdentity

In my ASP .NET MVC5 WebApp I am using Owin Identity to sign in with the @domain.com credentials and fetch data with the office 365 API Microsoft Graph. Another functionality of the WebApp is to read data from the Active Directory and allow the user…
blfuentes
  • 2,731
  • 5
  • 44
  • 72
4
votes
0 answers

Check if app is run by sudo/admin on Linux

I am trying to check if .Net code is running as sudo/admin on Linux. It works on Windows but throws exception on Linux. How do I check if app is run by admin/sudo on Ubuntu Linux by using .NET Core2.0 build-in class? Here is the code I have…
Reven
  • 776
  • 2
  • 8
  • 23
4
votes
0 answers

Principal IsInRole look up by group name fails, by SID Works C#

I am surprised that I cannot look up Windows group membership by the group name. I can use UserPrincipal.Current.GetGroups(); But I aparently cannot use Httpcontext.CurrentUser.IsInRole to look up the group membership by name to determine…
4
votes
1 answer

NServiceBus - How to configure bus to allow WindowsIdentity to flow from client

On the client I have setup the bus with ImpersonateSender(true) My server is configured AsA_Server, which by default should have ImpersonateSender(true) I'm now trying to retrieve the WindowsIdentity, from inside a Handler var windowsIdentity =…
John Simons
  • 4,288
  • 23
  • 41
4
votes
1 answer

How to get the current Windows user's *network* identity, not their interactive log-on identity?

Question: What is the .NET (or p/invoke to an unmanaged Windows API) method call to get the current process's network identity that is used to connect to SSPI-authenticated network services, such as SQL Server? The specific use-case I have in mind…
James Dunne
  • 3,607
  • 3
  • 24
  • 29
4
votes
2 answers

CryptographicException: The data is invalid in MVC 4 with WIF enabled

I have created a MVC 4 Project and set it up for Azure ACS. It worked with System.Identity. I changed it to use the Microsoft.Identity for enabling WIF and my config file looks like this now: