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 12 2664
You should call QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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
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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
When calling QuerySecurityCo ntextToken , you have to pass the adress of the
Server context handle (&asServer.hctx t), you could make this call before
returning from SSPLogonUser and return the access token obtained by calling
QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
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 QuerySecurityCo ntextToken , you have to pass the adress of the Server context handle (&asServer.hctx t), you could make this call before returning from SSPLogonUser and return the access token obtained by calling QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
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.mic rosoft.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 QuerySecurityCo ntextToken , you have to pass the adress of the Server context handle (&asServer.hctx t), you could make this call
before returning from SSPLogonUser and return the access token obtained by calling QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
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.mic rosoft.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 QuerySecurityCo ntextToken , you have to pass the adress of > the > Server context handle (&asServer.hctx t), you could make this call before > returning from SSPLogonUser and return the access token obtained by > calling > QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
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.mic rosoft.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.mic rosoft.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 QuerySecurityCo ntextToken , you have to pass the adress of > the > Server context handle (&asServer.hctx t), you could make this call before > returning from SSPLogonUser and return the access token obtained by > calling > QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
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******** ******@TK2MSFTN GP11.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.mic rosoft.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.mic rosoft.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 QuerySecurityCo ntextToken , you have to pass the
adress> of > > the > > Server context handle (&asServer.hctx t), you could make this call before > > returning from SSPLogonUser and return the access token obtained by > > calling > > QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
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******** ********@TK2MSF TNGP09.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******** ******@TK2MSFTN GP11.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.mic rosoft.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.mic rosoft.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 QuerySecurityCo ntextToken , you have to pass the adress >> of >> > the >> > Server context handle (&asServer.hctx t), you could make this call > before >> > returning from SSPLogonUser and return the access token obtained
by >> > calling >> > QuerySecurityCo ntextToken, 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.mic rosoft.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 QuerySecurityCo ntextToken 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.mic rosoft.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&NoWebCon tent=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/
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 machine are not on Domain and not in AD
environment.
I userstand the the web page from A is to create a user account on B
should use Impersonate function to log in as the user from the machine
|
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 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.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q180/5/48.asp&NoWebContent=1)
|
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. restart a service or list the available processes I keep getting access denied exceptions. Here is an example of my code:
public extern static bool LogonUser(String lpszUsername, String lpszDomain,
String lpszPassword, int dwLogonType,
int...
|
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 it to run using credentials supplied by the user.
When using basic authentication this is not an issue since the user
has to provide a user name and password.
But I don't want to use basic authentication so I created a login form
and I am using...
|
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 Analysis Services. It seems
impossible to make the impersonation work. Every path I try seems to be
blocked.
Path number one: set <identity impersonate=false/> in web.config
OK. The Website is up, but it cannot access the datawarehouse because the...
| |
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, I always get ERROR: Access
is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
First I thought its the permission problem, so I set permission of that
directory to everyone (not an secure idea, but for test only). I found
out that...
|
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 article:
http://support.microsoft.com/?id=306158#4
This doesn't work in Windows 2008 Server, we receive the following exception:
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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...
|
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,...
| |
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |