Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: "Eric" <bigfoot@xxxxxxxxxxxxxxxx>
- Date: Tue, 7 Mar 2006 11:02:05 -0000
The problem is that the WindowsIdentity.GetCurrent() does return the account
of the service is running under and this is not what I need, what I need is
to test the remote caller.
I just remind you what I am doing:
I doing remoting calls over a TCP channel set to "SECURE", which so far I
can see, means that on the server side (service) the
System.Threading.Thread.CurrentPrincipal will be set with the identiy of the
remote caller. Because I am not, and do not want, impersonating, the
WindowsIdentity.GetCurrent() is still set to the serive account.
The System.Threading.Thread.CurrentPrincipal contains the identidy of the
remote caller, the one on which I want to test if he is member of a group or
not.
I based my code on the following document tation from MS
http://msdn2.microsoft.com/en-us/library/kw7c6kwc.aspx to set the property
of the TCP channel:
secure (TcpChannel)
A Boolean value (true or false) that specifies whether communications
on the channel are secure. The default is false. When it is set to true, the
tokenImpersonationLevel property is set to Identification and the
protectionLevel property is set to EncryptAndSign. Note that a secure
TcpClientChannel may connect only to a secure TcpServerChannel, and a
non-secure TcpClientChannel may connect only to a non-secure
TcpServerChannel.
Note
If the server computer is running Windows 95, Windows 98, or
Windows Me, the TcpServerChannel cannot be specified as secure.
TcpChannel
TcpClientChannel
TcpServerChannel
Also here is a decription of the tokenImpersaonationLevel from
http://msdn2.microsoft.com/en-us/library/system.security.principal.tokenimpersonationlevel.aspx:
Member name Description
Anonymous The server process cannot obtain identification
information about the client, and it cannot impersonate the client.
Delegation The server process can impersonate the client's security
context on remote systems.
Identification The server process can obtain information about the
client, such as security identifiers and privileges, but it cannot
impersonate the client. This is useful for servers that export their own
objects, for example, database products that export tables and views. Using
the retrieved client-security information, the server can make
access-validation decisions without being able to use other services that
are using the client's security context.
Impersonation The server process can impersonate the client's
security context on its local system. The server cannot impersonate the
client on remote systems.
None An impersonation level is not assigned.
When debuging my code, I can see the
System.Threading.Thread.CurrentPrincipal set properly with the remote
caller, the AuthetificationToken is set to Identification but I am not able
to test if the user is member of a specific group (IsInrole) return false
all the time, which is the only thing I want to do -:) . Reading the
description of "Identification" above you will think that it should be
possible no?
Cheers,
Eric
"Luke Zhang [MSFT]" <lukezhan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:iNeqt8YQGHA.4620@xxxxxxxxxxxxxxxxxxxxxxxx
I mean "System.Threading.Thread.CurrentPrincipal.IsInRole()" won't return
correct result, you may still use:
WindowsPrincipal aWinPrinc = new
WindowsPrincipal(WindowsIdentity.GetCurrent());
If there is anything unclear, please feel free to let me know.
Luke Zhang
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
begin 666 kw7c6kwc.note.gif
M1TE&.#EA"@`*`+,)`/\$`/]=6L;#QM;3UO_/`(2&A(R.C ```/__SO___P``
M`````````````````````"'Y! $```D`+ `````*``H```0HT,@Y1 `&Z7T(
AWEIW)!E'C.16G$.2(L-1((5;%D-H@_H+HH>@,.B*```[
`
end
.
- Follow-Ups:
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- References:
- RE: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Eric
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Eric
- Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- From: Luke Zhang [MSFT]
- RE: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Prev by Date: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Next by Date: Remoting or Web Services
- Previous by thread: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Next by thread: Re: IsInRole always return fasle on secure remoting call (Framework 2.0)
- Index(es):
Relevant Pages
|