473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Impersonate with SSPLogonUser

Hi!

I've made a Web Service using C# that is using impersonation.
The WS is working fine on WinXP and Win2003Server, but I'm having problem
getting it to work on Win2000.

The problem is that in order to use LogonUser on Win2000, you have to have
the SE_TCB_NAME privilege.
Therefore I'm using the SSPLogonUser
(http://support.microsoft.com/default...NoWebContent=1)
to authenticate the user.
This is working.

To be able to impersonate, I use the DuplicateToken API function.
This function takes a token as parameter, and I don't know how to obtain
that token.
When using the LogonUser function, you get a token in return, so on WinXP
and Win2003Server the problem doesn't arise.

I tried using WindowsIdentity.GetCurrent() after calling SSPLogonUser, but
it seems as if the token I'm getting is the wrong one.

Does anyone have an idea on how I can obtain this token?

Thanks in advance!

Regards,
Nils Magne Lunde
Nov 17 '05 #1
12 2629
You should call QuerySecurityContextToken to obtain a token from the
security package.
Note however that this token has no network credentials.

Willy.
"Nils M. Lunde" <ni****@nospam.options.no> wrote in message
news:op**************@news.microsoft.com...
Hi!

I've made a Web Service using C# that is using impersonation.
The WS is working fine on WinXP and Win2003Server, but I'm having problem
getting it to work on Win2000.

The problem is that in order to use LogonUser on Win2000, you have to have
the SE_TCB_NAME privilege.
Therefore I'm using the SSPLogonUser
(http://support.microsoft.com/default....microsoft.com
:80/support/kb/articles/Q180/5/48.asp&NoWebContent=1) to authenticate the user.
This is working.

To be able to impersonate, I use the DuplicateToken API function.
This function takes a token as parameter, and I don't know how to obtain
that token.
When using the LogonUser function, you get a token in return, so on WinXP
and Win2003Server the problem doesn't arise.

I tried using WindowsIdentity.GetCurrent() after calling SSPLogonUser, but
it seems as if the token I'm getting is the wrong one.

Does anyone have an idea on how I can obtain this token?

Thanks in advance!

Regards,
Nils Magne Lunde

Nov 17 '05 #2
Ok, I see.
Is there an easy way for me to obtain the security context that is used as
input to this function, or do I have to make the SSPLogonUser return this
context?

-Nils Magne

On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
You should call QuerySecurityContextToken to obtain a token from the
security package.
Note however that this token has no network credentials.

Willy.
"Nils M. Lunde" <ni****@nospam.options.no> wrote in message
news:op**************@news.microsoft.com...
Hi!

I've made a Web Service using C# that is using impersonation.
The WS is working fine on WinXP and Win2003Server, but I'm having
problem
getting it to work on Win2000.

The problem is that in order to use LogonUser on Win2000, you have to
have
the SE_TCB_NAME privilege.
Therefore I'm using the SSPLogonUser

(http://support.microsoft.com/default....microsoft.com
:80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
to authenticate the user.
This is working.

To be able to impersonate, I use the DuplicateToken API function.
This function takes a token as parameter, and I don't know how to obtain
that token.
When using the LogonUser function, you get a token in return, so on
WinXP
and Win2003Server the problem doesn't arise.

I tried using WindowsIdentity.GetCurrent() after calling SSPLogonUser,
but
it seems as if the token I'm getting is the wrong one.

Does anyone have an idea on how I can obtain this token?

Thanks in advance!

Regards,
Nils Magne Lunde



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 17 '05 #3
When calling QuerySecurityContextToken , you have to pass the adress of the
Server context handle (&asServer.hctxt), you could make this call before
returning from SSPLogonUser and return the access token obtained by calling
QuerySecurityContextToken, or you could implement another function that
takes the context handle and returns the token? it's up to you ;-)

Willy.
"Nils M. Lunde" <ni****@nospam.options.no> wrote in message
news:op**************@news.microsoft.com...
Ok, I see.
Is there an easy way for me to obtain the security context that is used as
input to this function, or do I have to make the SSPLogonUser return this
context?

-Nils Magne

On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
You should call QuerySecurityContextToken to obtain a token from the
security package.
Note however that this token has no network credentials.

Willy.
"Nils M. Lunde" <ni****@nospam.options.no> wrote in message
news:op**************@news.microsoft.com...
Hi!

I've made a Web Service using C# that is using impersonation.
The WS is working fine on WinXP and Win2003Server, but I'm having
problem
getting it to work on Win2000.

The problem is that in order to use LogonUser on Win2000, you have to
have
the SE_TCB_NAME privilege.
Therefore I'm using the SSPLogonUser

(http://support.microsoft.com/default....microsoft.com :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
to authenticate the user.
This is working.

To be able to impersonate, I use the DuplicateToken API function.
This function takes a token as parameter, and I don't know how to obtain that token.
When using the LogonUser function, you get a token in return, so on
WinXP
and Win2003Server the problem doesn't arise.

I tried using WindowsIdentity.GetCurrent() after calling SSPLogonUser,
but
it seems as if the token I'm getting is the wrong one.

Does anyone have an idea on how I can obtain this token?

Thanks in advance!

Regards,
Nils Magne Lunde



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 17 '05 #4
Thanks!
I got i to work on Win2000 Professional.
Now I only have to find a way to get it to work on Win2000 Server.
It seems as if the token is somewhat invalid, and I don't have access to
anything after impersonating using it.

Nils Magne

On Mon, 12 Jan 2004 13:39:44 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
When calling QuerySecurityContextToken , you have to pass the adress of
the
Server context handle (&asServer.hctxt), you could make this call before
returning from SSPLogonUser and return the access token obtained by
calling
QuerySecurityContextToken, or you could implement another function that
takes the context handle and returns the token? it's up to you ;-)

Willy.
"Nils M. Lunde" <ni****@nospam.options.no> wrote in message
news:op**************@news.microsoft.com...
Ok, I see.
Is there an easy way for me to obtain the security context that is used
as
input to this function, or do I have to make the SSPLogonUser return
this
context?

-Nils Magne

On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
> You should call QuerySecurityContextToken to obtain a token from the
> security package.
> Note however that this token has no network credentials.
>
> Willy.
>
>
> "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
> news:op**************@news.microsoft.com...
>> Hi!
>>
>> I've made a Web Service using C# that is using impersonation.
>> The WS is working fine on WinXP and Win2003Server, but I'm having
>> problem
>> getting it to work on Win2000.
>>
>> The problem is that in order to use LogonUser on Win2000, you have to
>> have
>> the SE_TCB_NAME privilege.
>> Therefore I'm using the SSPLogonUser
>>
> (http://support.microsoft.com/default....microsoft.com > :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
>> to authenticate the user.
>> This is working.
>>
>> To be able to impersonate, I use the DuplicateToken API function.
>> This function takes a token as parameter, and I don't know how to obtain >> that token.
>> When using the LogonUser function, you get a token in return, so on
>> WinXP
>> and Win2003Server the problem doesn't arise.
>>
>> I tried using WindowsIdentity.GetCurrent() after calling

SSPLogonUser,
>> but
>> it seems as if the token I'm getting is the wrong one.
>>
>> Does anyone have an idea on how I can obtain this token?
>>
>> Thanks in advance!
>>
>> Regards,
>> Nils Magne Lunde
>
>


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 17 '05 #5
What exactly do you mean with "I don't have access to anything"?
Note that the token obtained has not network credentials, so network
resources are not accessible when impersonating.

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
Thanks!
I got i to work on Win2000 Professional.
Now I only have to find a way to get it to work on Win2000 Server.
It seems as if the token is somewhat invalid, and I don't have access to
anything after impersonating using it.

Nils Magne

On Mon, 12 Jan 2004 13:39:44 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
When calling QuerySecurityContextToken , you have to pass the adress of
the
Server context handle (&asServer.hctxt), you could make this call before
returning from SSPLogonUser and return the access token obtained by
calling
QuerySecurityContextToken, or you could implement another function that
takes the context handle and returns the token? it's up to you ;-)

Willy.
"Nils M. Lunde" <ni****@nospam.options.no> wrote in message
news:op**************@news.microsoft.com...
Ok, I see.
Is there an easy way for me to obtain the security context that is used
as
input to this function, or do I have to make the SSPLogonUser return
this
context?

-Nils Magne

On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:

> You should call QuerySecurityContextToken to obtain a token from the
> security package.
> Note however that this token has no network credentials.
>
> Willy.
>
>
> "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
> news:op**************@news.microsoft.com...
>> Hi!
>>
>> I've made a Web Service using C# that is using impersonation.
>> The WS is working fine on WinXP and Win2003Server, but I'm having
>> problem
>> getting it to work on Win2000.
>>
>> The problem is that in order to use LogonUser on Win2000, you have to >> have
>> the SE_TCB_NAME privilege.
>> Therefore I'm using the SSPLogonUser
>>
>

(http://support.microsoft.com/default....microsoft.com
> :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
>> to authenticate the user.
>> This is working.
>>
>> To be able to impersonate, I use the DuplicateToken API function.
>> This function takes a token as parameter, and I don't know how to

obtain
>> that token.
>> When using the LogonUser function, you get a token in return, so on
>> WinXP
>> and Win2003Server the problem doesn't arise.
>>
>> I tried using WindowsIdentity.GetCurrent() after calling
SSPLogonUser,
>> but
>> it seems as if the token I'm getting is the wrong one.
>>
>> Does anyone have an idea on how I can obtain this token?
>>
>> Thanks in advance!
>>
>> Regards,
>> Nils Magne Lunde
>
>

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 17 '05 #6
I mean that after impersonating with that token, I only have guest
privilegies on this computer.
On WinXP, 2003Server and 2000Pro I can impersonate any domain user, and
have access to the same resources as if I was loged in as this user. On
Win2000Server I only have guest privilegies no matter who I'm
impersonating.

The 2000Server I'm using is the pdc of our domain.
Could that be the reason?

Nils Magne

On Tue, 13 Jan 2004 17:05:32 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
What exactly do you mean with "I don't have access to anything"?
Note that the token obtained has not network credentials, so network
resources are not accessible when impersonating.

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
Thanks!
I got i to work on Win2000 Professional.
Now I only have to find a way to get it to work on Win2000 Server.
It seems as if the token is somewhat invalid, and I don't have access to
anything after impersonating using it.

Nils Magne

On Mon, 12 Jan 2004 13:39:44 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
> When calling QuerySecurityContextToken , you have to pass the adress

of
> the
> Server context handle (&asServer.hctxt), you could make this call before > returning from SSPLogonUser and return the access token obtained by
> calling
> QuerySecurityContextToken, or you could implement another function

that
> takes the context handle and returns the token? it's up to you ;-)
>
> Willy.
>
>
> "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
> news:op**************@news.microsoft.com...
>> Ok, I see.
>> Is there an easy way for me to obtain the security context that is

used
>> as
>> input to this function, or do I have to make the SSPLogonUser return
>> this
>> context?
>>
>> -Nils Magne
>>
>> On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
>> <wi*************@pandora.be> wrote:
>>
>> > You should call QuerySecurityContextToken to obtain a token from

the
>> > security package.
>> > Note however that this token has no network credentials.
>> >
>> > Willy.
>> >
>> >
>> > "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
>> > news:op**************@news.microsoft.com...
>> >> Hi!
>> >>
>> >> I've made a Web Service using C# that is using impersonation.
>> >> The WS is working fine on WinXP and Win2003Server, but I'm having
>> >> problem
>> >> getting it to work on Win2000.
>> >>
>> >> The problem is that in order to use LogonUser on Win2000, you have to >> >> have
>> >> the SE_TCB_NAME privilege.
>> >> Therefore I'm using the SSPLogonUser
>> >>
>> >
> (http://support.microsoft.com/default....microsoft.com >> > :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
>> >> to authenticate the user.
>> >> This is working.
>> >>
>> >> To be able to impersonate, I use the DuplicateToken API function.
>> >> This function takes a token as parameter, and I don't know how to
> obtain
>> >> that token.
>> >> When using the LogonUser function, you get a token in return, so

on
>> >> WinXP
>> >> and Win2003Server the problem doesn't arise.
>> >>
>> >> I tried using WindowsIdentity.GetCurrent() after calling
>> SSPLogonUser,
>> >> but
>> >> it seems as if the token I'm getting is the wrong one.
>> >>
>> >> Does anyone have an idea on how I can obtain this token?
>> >>
>> >> Thanks in advance!
>> >>
>> >> Regards,
>> >> Nils Magne Lunde
>> >
>> >
>>
>>
>>
>> --
>> Using M2, Opera's revolutionary e-mail client:

http://www.opera.com/m2/
>
>


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 17 '05 #7
Ok, I've tested my Web Service on other Win2k Servers, and it appears to
work on every computer except from the pdc.
Anyone who knows why SSPLogonUser fails on our Win2k Server pdc?

-Nils Magne

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
I mean that after impersonating with that token, I only have guest
privilegies on this computer.
On WinXP, 2003Server and 2000Pro I can impersonate any domain user, and
have access to the same resources as if I was loged in as this user. On
Win2000Server I only have guest privilegies no matter who I'm
impersonating.

The 2000Server I'm using is the pdc of our domain.
Could that be the reason?

Nils Magne

On Tue, 13 Jan 2004 17:05:32 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
What exactly do you mean with "I don't have access to anything"?
Note that the token obtained has not network credentials, so network
resources are not accessible when impersonating.

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
Thanks!
I got i to work on Win2000 Professional.
Now I only have to find a way to get it to work on Win2000 Server.
It seems as if the token is somewhat invalid, and I don't have access to anything after impersonating using it.

Nils Magne

On Mon, 12 Jan 2004 13:39:44 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:

> When calling QuerySecurityContextToken , you have to pass the adress
of
> the
> Server context handle (&asServer.hctxt), you could make this call

before
> returning from SSPLogonUser and return the access token obtained by
> calling
> QuerySecurityContextToken, or you could implement another function
that
> takes the context handle and returns the token? it's up to you ;-)
>
> Willy.
>
>
> "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
> news:op**************@news.microsoft.com...
>> Ok, I see.
>> Is there an easy way for me to obtain the security context that is
used
>> as
>> input to this function, or do I have to make the SSPLogonUser return
>> this
>> context?
>>
>> -Nils Magne
>>
>> On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
>> <wi*************@pandora.be> wrote:
>>
>> > You should call QuerySecurityContextToken to obtain a token from
the
>> > security package.
>> > Note however that this token has no network credentials.
>> >
>> > Willy.
>> >
>> >
>> > "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
>> > news:op**************@news.microsoft.com...
>> >> Hi!
>> >>
>> >> I've made a Web Service using C# that is using impersonation.
>> >> The WS is working fine on WinXP and Win2003Server, but I'm having
>> >> problem
>> >> getting it to work on Win2000.
>> >>
>> >> The problem is that in order to use LogonUser on Win2000, you have
to
>> >> have
>> >> the SE_TCB_NAME privilege.
>> >> Therefore I'm using the SSPLogonUser
>> >>
>> >
>

(http://support.microsoft.com/default....microsoft.com >> > :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
>> >> to authenticate the user.
>> >> This is working.
>> >>
>> >> To be able to impersonate, I use the DuplicateToken API function.
>> >> This function takes a token as parameter, and I don't know how to
> obtain
>> >> that token.
>> >> When using the LogonUser function, you get a token in return, so
on
>> >> WinXP
>> >> and Win2003Server the problem doesn't arise.
>> >>
>> >> I tried using WindowsIdentity.GetCurrent() after calling
>> SSPLogonUser,
>> >> but
>> >> it seems as if the token I'm getting is the wrong one.
>> >>
>> >> Does anyone have an idea on how I can obtain this token?
>> >>
>> >> Thanks in advance!
>> >>
>> >> Regards,
>> >> Nils Magne Lunde
>> >
>> >
>>
>>
>>
>> --
>> Using M2, Opera's revolutionary e-mail client:
http://www.opera.com/m2/
>
>

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Nov 17 '05 #8
Interactive logons for non domain admin users are disallowed on PDCs. Maybe
that is related to the issue you are seeing.

Ronald Laeremans

"Nils M. Lunde" <ni****@options.no> wrote in message
news:eC**************@TK2MSFTNGP11.phx.gbl...
Ok, I've tested my Web Service on other Win2k Servers, and it appears to
work on every computer except from the pdc.
Anyone who knows why SSPLogonUser fails on our Win2k Server pdc?

-Nils Magne

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
I mean that after impersonating with that token, I only have guest
privilegies on this computer.
On WinXP, 2003Server and 2000Pro I can impersonate any domain user, and
have access to the same resources as if I was loged in as this user. On
Win2000Server I only have guest privilegies no matter who I'm
impersonating.

The 2000Server I'm using is the pdc of our domain.
Could that be the reason?

Nils Magne

On Tue, 13 Jan 2004 17:05:32 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:
What exactly do you mean with "I don't have access to anything"?
Note that the token obtained has not network credentials, so network
resources are not accessible when impersonating.

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
> Thanks!
> I got i to work on Win2000 Professional.
> Now I only have to find a way to get it to work on Win2000 Server.
> It seems as if the token is somewhat invalid, and I don't have access to> anything after impersonating using it.
>
> Nils Magne
>
> On Mon, 12 Jan 2004 13:39:44 +0100, Willy Denoyette [MVP]
> <wi*************@pandora.be> wrote:
>
> > When calling QuerySecurityContextToken , you have to pass the adress> of
> > the
> > Server context handle (&asServer.hctxt), you could make this call
before
> > returning from SSPLogonUser and return the access token obtained by
> > calling
> > QuerySecurityContextToken, or you could implement another function
> that
> > takes the context handle and returns the token? it's up to you ;-)
> >
> > Willy.
> >
> >
> > "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
> > news:op**************@news.microsoft.com...
> >> Ok, I see.
> >> Is there an easy way for me to obtain the security context that is
> used
> >> as
> >> input to this function, or do I have to make the SSPLogonUser return> >> this
> >> context?
> >>
> >> -Nils Magne
> >>
> >> On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
> >> <wi*************@pandora.be> wrote:
> >>
> >> > You should call QuerySecurityContextToken to obtain a token from
> the
> >> > security package.
> >> > Note however that this token has no network credentials.
> >> >
> >> > Willy.
> >> >
> >> >
> >> > "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
> >> > news:op**************@news.microsoft.com...
> >> >> Hi!
> >> >>
> >> >> I've made a Web Service using C# that is using impersonation.
> >> >> The WS is working fine on WinXP and Win2003Server, but I'm having> >> >> problem
> >> >> getting it to work on Win2000.
> >> >>
> >> >> The problem is that in order to use LogonUser on Win2000, you have to
> >> >> have
> >> >> the SE_TCB_NAME privilege.
> >> >> Therefore I'm using the SSPLogonUser
> >> >>
> >> >
> >

(http://support.microsoft.com/default....microsoft.com
> >> > :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
> >> >> to authenticate the user.
> >> >> This is working.
> >> >>
> >> >> To be able to impersonate, I use the DuplicateToken API function.> >> >> This function takes a token as parameter, and I don't know how to> > obtain
> >> >> that token.
> >> >> When using the LogonUser function, you get a token in return, so> on
> >> >> WinXP
> >> >> and Win2003Server the problem doesn't arise.
> >> >>
> >> >> I tried using WindowsIdentity.GetCurrent() after calling
> >> SSPLogonUser,
> >> >> but
> >> >> it seems as if the token I'm getting is the wrong one.
> >> >>
> >> >> Does anyone have an idea on how I can obtain this token?
> >> >>
> >> >> Thanks in advance!
> >> >>
> >> >> Regards,
> >> >> Nils Magne Lunde
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> Using M2, Opera's revolutionary e-mail client:
> http://www.opera.com/m2/
> >
> >
>
>
>
> --
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


Nov 17 '05 #9
I am a domain admin, so that shouldn't be a problem.
Could it be that impersonation using the techniques in SSPLogonUser is
disallowed on PDCs?

Nils Magne

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Interactive logons for non domain admin users are disallowed on PDCs. Maybe that is related to the issue you are seeing.

Ronald Laeremans

"Nils M. Lunde" <ni****@options.no> wrote in message
news:eC**************@TK2MSFTNGP11.phx.gbl...
Ok, I've tested my Web Service on other Win2k Servers, and it appears to
work on every computer except from the pdc.
Anyone who knows why SSPLogonUser fails on our Win2k Server pdc?

-Nils Magne

"Nils M. Lunde" <ni****@options.no> wrote in message
news:op**************@news.microsoft.com...
I mean that after impersonating with that token, I only have guest
privilegies on this computer.
On WinXP, 2003Server and 2000Pro I can impersonate any domain user, and have access to the same resources as if I was loged in as this user. On Win2000Server I only have guest privilegies no matter who I'm
impersonating.

The 2000Server I'm using is the pdc of our domain.
Could that be the reason?

Nils Magne

On Tue, 13 Jan 2004 17:05:32 +0100, Willy Denoyette [MVP]
<wi*************@pandora.be> wrote:

> What exactly do you mean with "I don't have access to anything"?
> Note that the token obtained has not network credentials, so network
> resources are not accessible when impersonating.
>
> Willy.
>
> "Nils M. Lunde" <ni****@options.no> wrote in message
> news:op**************@news.microsoft.com...
>> Thanks!
>> I got i to work on Win2000 Professional.
>> Now I only have to find a way to get it to work on Win2000 Server.
>> It seems as if the token is somewhat invalid, and I don't have access
to
>> anything after impersonating using it.
>>
>> Nils Magne
>>
>> On Mon, 12 Jan 2004 13:39:44 +0100, Willy Denoyette [MVP]
>> <wi*************@pandora.be> wrote:
>>
>> > When calling QuerySecurityContextToken , you have to pass the adress >> of
>> > the
>> > Server context handle (&asServer.hctxt), you could make this call
> before
>> > returning from SSPLogonUser and return the access token obtained
by >> > calling
>> > QuerySecurityContextToken, or you could implement another function >> that
>> > takes the context handle and returns the token? it's up to you ;-) >> >
>> > Willy.
>> >
>> >
>> > "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
>> > news:op**************@news.microsoft.com...
>> >> Ok, I see.
>> >> Is there an easy way for me to obtain the security context that is >> used
>> >> as
>> >> input to this function, or do I have to make the SSPLogonUser return >> >> this
>> >> context?
>> >>
>> >> -Nils Magne
>> >>
>> >> On Fri, 9 Jan 2004 14:11:14 +0100, Willy Denoyette [MVP]
>> >> <wi*************@pandora.be> wrote:
>> >>
>> >> > You should call QuerySecurityContextToken to obtain a token from >> the
>> >> > security package.
>> >> > Note however that this token has no network credentials.
>> >> >
>> >> > Willy.
>> >> >
>> >> >
>> >> > "Nils M. Lunde" <ni****@nospam.options.no> wrote in message
>> >> > news:op**************@news.microsoft.com...
>> >> >> Hi!
>> >> >>
>> >> >> I've made a Web Service using C# that is using impersonation.
>> >> >> The WS is working fine on WinXP and Win2003Server, but I'm having >> >> >> problem
>> >> >> getting it to work on Win2000.
>> >> >>
>> >> >> The problem is that in order to use LogonUser on Win2000, you have
> to
>> >> >> have
>> >> >> the SE_TCB_NAME privilege.
>> >> >> Therefore I'm using the SSPLogonUser
>> >> >>
>> >> >
>> >
>

(http://support.microsoft.com/default....microsoft.com
>> >> > :80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
>> >> >> to authenticate the user.
>> >> >> This is working.
>> >> >>
>> >> >> To be able to impersonate, I use the DuplicateToken API function. >> >> >> This function takes a token as parameter, and I don't know
how to >> > obtain
>> >> >> that token.
>> >> >> When using the LogonUser function, you get a token in return, so >> on
>> >> >> WinXP
>> >> >> and Win2003Server the problem doesn't arise.
>> >> >>
>> >> >> I tried using WindowsIdentity.GetCurrent() after calling
>> >> SSPLogonUser,
>> >> >> but
>> >> >> it seems as if the token I'm getting is the wrong one.
>> >> >>
>> >> >> Does anyone have an idea on how I can obtain this token?
>> >> >>
>> >> >> Thanks in advance!
>> >> >>
>> >> >> Regards,
>> >> >> Nils Magne Lunde
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Using M2, Opera's revolutionary e-mail client:
>> http://www.opera.com/m2/
>> >
>> >
>>
>>
>>
>> --
>> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ >
>

--
Using M2, Opera's revolutionary e-mail client:

http://www.opera.com/m2/


Nov 17 '05 #10
Make sure HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Lsa\ForceGuest
is disabled (value 0).

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am a domain admin, so that shouldn't be a problem.
Could it be that impersonation using the techniques in SSPLogonUser is
disallowed on PDCs?

Nils Magne

Nov 17 '05 #11
This value does not exist in the registry.
Wasn't the ForceGuest value introduced in WinXP?
I tried to add it anyway, but it made no difference.

The strange thing is that the WS running on my test server (Windows 2000
Server SP 4 also), is working fine.
It has to be something with the security policies for PDCs.
Maybe there is another registry key I could change??

Thanks anyway!
-Nils Magne

"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Make sure HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Lsa\ForceGuest is disabled (value 0).

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am a domain admin, so that shouldn't be a problem.
Could it be that impersonation using the techniques in SSPLogonUser is
disallowed on PDCs?

Nils Magne


Nov 17 '05 #12
Ok, I finally got it to work!
I'm not sure if it is the best solution, but what I did was:

1. Open the Domain Controller Security Policy snap-in
2. In the User Rights Assignment page, add DOMAIN\IWAM_Computername to the
"Impersonate a client after authentication" policy.

I also got it working when running the process as the system identity by
changing to

<processModel userName="SYSTEM" password="AutoGenerate" />

in machine.config, but because this approach has serious security
implications, I desided not to go with it.

If anyone knows of a better method, please tell me!
-Nils Magne
"Nils M. Lunde" <ni****@options.no> wrote in message
news:ej*************@TK2MSFTNGP12.phx.gbl...
This value does not exist in the registry.
Wasn't the ForceGuest value introduced in WinXP?
I tried to add it anyway, but it made no difference.

The strange thing is that the WS running on my test server (Windows 2000
Server SP 4 also), is working fine.
It has to be something with the security policies for PDCs.
Maybe there is another registry key I could change??

Thanks anyway!
-Nils Magne

"Willy Denoyette [MVP]" <wi*************@pandora.be> wrote in message
news:Ox**************@TK2MSFTNGP09.phx.gbl...
Make sure

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Lsa\ForceGuest
is disabled (value 0).

Willy.

"Nils M. Lunde" <ni****@options.no> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am a domain admin, so that shouldn't be a problem.
Could it be that impersonation using the techniques in SSPLogonUser is
disallowed on PDCs?

Nils Magne



Nov 17 '05 #13

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

Similar topics

1
by: moemeelaung | last post by:
Hi ASP/Windows experts out there I really need help with this Impersonate function. I have machine A and B. A hosts my ASP page which is to create a user account on the machine B. The...
12
by: Nils M. Lunde | last post by:
Hi! I've made a Web Service using C# that is using impersonation. The WS is working fine on WinXP and Win2003Server, but I'm having problem getting it to work on Win2000. The problem is that...
14
by: Ian Frawley | last post by:
Anyone used the WindowsIdentity class with success? I find if I try to change the current identity to one that exists on another machine and then try to perform and action on that machine i.e....
6
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need...
1
by: Svein Terje Gaup | last post by:
I have a website running on Windows 2000 Server, that should be able to retrieve data from a datawarehouse on another machine running Windows 2000 Server, SQL Server 2000 and SQL Server 2000...
2
by: rockdale | last post by:
Hi, all: My asp.net application calles MS speech 5.1 and generate a wav file on server's path. Everything runs perfectly on my development machine. But when I move the appl to production server,...
4
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...

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.