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
0
votes
3 answers

VB.NET Error - Null Reference Exception could occur at run time when the result is used

Background: I wrote code that will output all the currently logged in User's Active Directory group names. I want the group name (ex: Acomp_user_BIG) via IdentityReference.Translate instead of the current user's SID's (ex: S-1-5-32-544) returned via…
0
votes
1 answer

HttpContext.Current.User returns admin account instead of user account

I have two Windows accounts, my regular user-level one, and an Administrator one. As far as I know, there is no connection between the two in AD, other than my name. I normally log into my dev machine using the user account. If I run my website…
DelphinusC
  • 83
  • 1
  • 11
0
votes
1 answer

System.Security.Principal.WindowsIdentity.GetCurrent().Name vs User.Identity.Name and which one should I use?

Just trying to understand the difference here. I moved my ASP.Net Core Vue.js app over to a Win server, from my Win 7 desktop, and it broke User.Identity.Name so now the value is null. So I changed it to…
chuckd
  • 13,460
  • 29
  • 152
  • 331
0
votes
0 answers

WindowsIdentity.Impersonate in ASP.NET randomly “Invalid token for impersonation - it cannot be duplicated"

I have a web application that has an HTML 5 front end that calls (via Ajax & JSON) to a .NET MVC web app. The goal is to allow domain users to automatically authenticate against Active Directory and impersonate the user so that when IIS accesses…
Graham Harris
  • 319
  • 1
  • 2
  • 16
0
votes
1 answer

WindowsIdentity.Name doesn't return new name from Active Directory

Any help on this would be TRULY appreciated. I'll spare you the details, but we have to rename all of our Active Directory users from [First name] [Last Name] to [First Initial][Last Name] to get the space out of the usernames. We have a production…
0
votes
1 answer

Client/Server app, how to create process on remote system as a domain user without transferring that users username/password to the remote system?

I have two systems both running my C# client/server software code. I want to from Computer 1 create a process as a given Active Directory domain user on Computer 2 without having to have my client/server software send the plain text username and…
Paul W.
  • 299
  • 1
  • 5
  • 15
0
votes
1 answer

Passing Windows Identity name to server

I need to get my logged in Windows user name, from the PC I am using to the server hosting my site. In my code I have the following line: var user = WindowsIdentity.GetCurrent().Name; When I run my project locally it returns what I expect:…
Sean
  • 897
  • 4
  • 20
  • 42
0
votes
1 answer

Get logged-in user in html page with C# code and without opening in VS?

We have a pure html page running in our IIS, and we would like to know what logged-in users are accessing the page. By "logged-in" users I mean a user that looged on to our intranet in their Windows machine. It seems that I can't retrieve this…
fdkgfosfskjdlsjdlkfsf
  • 3,165
  • 2
  • 43
  • 110
0
votes
1 answer

SecurityNegotiationException when trying to issue a security token request

I am getting trying to make an Issue request to my STS and I keep getting the following exception: System.ServiceModel.Security.SecurityNegotiationException' occurred in mscorlib.dll but was not handled in user code Additional information: Could…
Pablo
  • 2,054
  • 8
  • 30
  • 56
0
votes
1 answer

Get Windows LiveID by first and last name

in my company, we're using MS Outlook and Skype. In both applications, I can click on several user to get information about them like the first name, the last name, availability, email adress or the information of WindowsIdentification.Name (i…
Jan021981
  • 521
  • 3
  • 28
0
votes
0 answers

WindowsIdentity.GetCurrent().Name Throws Exception On Azure IIS

I have deployed my web application on azure cloud.When i try to get identity user using WindowsIdentity.GetCurrent(). Name It throws me following exception System.Security.SecurityException: at …
0
votes
1 answer

ASP.Net Impersonation fails when using machine name or IP in url

Im stuck with the following problem: I have small MVC application that uses Windows Identity and ASP.Net Impersonation for querying data from MS Project Server. Everything works fine when using localhost. But when accessing site with url that…
Marek
  • 261
  • 4
  • 14
0
votes
1 answer

validate against an ActiveDirectory group of WCF caller in the server side

I have a WCF service, hosted in a WindowService, using nettcpbinding in which I want to perform check in the C# code if the sender belongs to a specific AD group. Is it possible? if so, how?
Joezer
  • 625
  • 1
  • 9
  • 20
0
votes
1 answer

Principal.IsInRole returns different results for the same WindowsPrincipal, depending on how it is constructed

I have two ways to construct the same WindowsPrincipal object Depending on how I construct it, I get different results for principal.IsInRole() Here's my code: var principal1 = new WindowsPrincipal(WindowsIdentity.GetCurrent()); var principal2 =…
0
votes
1 answer

Current windowsidentity same as currentrequest user identity with windows authentication

I have a weird issue with windows authentication. We have an asp.net webforms application in which we have a single folder that uses windows authentication. This folder is correctly configured for windows authentication in IIS. The application uses…
PaulVrugt
  • 1,682
  • 2
  • 17
  • 40