473,657 Members | 2,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NullUser and WindowsIdentity (ImpersonateAno nymousToken) has no groups


I create a user token for the windows anonymous user ("NT AUTHORITY\ANONY MOUS
LOGON") using ImpersonateAnon ymousToken. I successfully create a WindowsIdentity
from that token, but the Groups property always reports zero groups, even
though I have added the "NT AUTHORITY\ANONY MOUS LOGON" user to groups manually.

What am I doing wrong?
May 30 '06 #1
2 1783
I don't think that "Anonymous Logon" can be added to any group...

I had the same problem sometime back... I had to create another user and
assign groups to the new user.

Not sure if I missed some information then or I am still missing something
now....
--
Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
http://webservices.edujini.in
-------------------
"Eric Pearson" <re***@newsgrou ponly.please> wrote in message
news:e3******** *************** **@msnews.micro soft.com...

I create a user token for the windows anonymous user ("NT
AUTHORITY\ANONY MOUS LOGON") using ImpersonateAnon ymousToken. I
successfully create a WindowsIdentity from that token, but the Groups
property always reports zero groups, even though I have added the "NT
AUTHORITY\ANONY MOUS LOGON" user to groups manually.

What am I doing wrong?

May 30 '06 #2
Yes, as I said "even though I have added the "NT AUTHORITY\ANONY MOUS LOGON"
user to groups manually.".

go to add a user to any group, type "ANONYMOUS LOGON" for the user, and it
should resolve to "NT AUTHORITY\Anony mous Logon". It's just through code
those groups don't get associated.
I don't think that "Anonymous Logon" can be added to any group...

I had the same problem sometime back... I had to create another user
and assign groups to the new user.

Not sure if I missed some information then or I am still missing
something now....

"Eric Pearson" <re***@newsgrou ponly.please> wrote in message
news:e3******** *************** **@msnews.micro soft.com...
I create a user token for the windows anonymous user ("NT
AUTHORITY\ANONY MOUS LOGON") using ImpersonateAnon ymousToken. I
successfully create a WindowsIdentity from that token, but the Groups
property always reports zero groups, even though I have added the "NT
AUTHORITY\ANONY MOUS LOGON" user to groups manually.

What am I doing wrong?

May 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
33028
by: BLiTZWiNG | last post by:
After playing with the code shown and utilising Willy Denyottes' help, I have come to the conclusion that there is some form of difference between the managed WindowsIdentity.Impersonate() over the unmanaged ImpersonateLoggedOnUser(). Below is my code showing a file copy to a remote computer's shared folder using both WindowsImpersonationContext and ImpersonateLoggedOnUser/RevertToSelf, with the latter currently commented out. The...
3
2482
by: diephouse | last post by:
I seem to be having a problem accessing networks shares. For example, I try the following code: File.Exists(@"\\SERVER\share"); always returns false! Or even if I map the drive File.Exists(@"Z:\") that will always return false as well. I can't seem to find too much
3
4285
by: Kevin Burton | last post by:
This is more of a solution that raised a question. I have a Web service that does not allow anonymous users. For debugging I put in the following lines in my Web Service: WindowsIdentity wi = WindowsIdentity.GetCurrent(); WindowsPrincipal wp = Thread.CurrentPrincipal as WindowsPrincipal; wi = wp.Identity as WindowsIdentity;
8
9449
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
3
5073
by: Derek Martin | last post by:
Does anyone know how to get the current logged on NAME from AD? I can get the username domain\username, but I would like to actually get John W. Doe from the currently logged in person. Anyone? Help? hehe Derek -- Derek Martin 593074
13
12951
by: ALI-R | last post by:
I know how to authenticate to a webservice using either of these ways(Assuming that rService represents the webservice): 1) rService.Credentials = new System.Net.NetworkCredential("username","password","domainName"); 2)rService.Credentials = System.Net.CredentialCache.DefaultCredentials; My question is that is there a way to authenticate to a user using WindowsIdentity ???
1
1987
by: Raghu | last post by:
If a company has windows machines but the directory services is not active directory (say novell's eDirectory for whatever reason and users are authenticated against this non-AD directory services), will the WindowsIdentity object (obtained through WindowsIdentity.GetCurrent static method) in any .net application have necessary group memberships available? Since ldap group implementation in each directory service vendor vary...
2
1903
by: gary.comstock | last post by:
We have setup 4 NT groups - Executive, Manager, Employee and Contractor. The premise is that an Executive has all of the privileges of Itself plus Manager plus Employee plus Contractor while an Employee only has itself and Contractor. We did this as a hierarchy where the higher (i.e. Executive) has a member of the one directly below (i.e. Manager): Executive has a member of Manager Manager has a member of Employee
10
26800
by: Jeff Williams | last post by:
How can I get a list of the Groups both Local and Domain groups a User belongs to.
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8613
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.