[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Any reason I would not be able to pass an IPrincipal object?

Gary A. Bushey [MVP]

9/20/2004 7:12:00 PM

I am (very) new to .Net Remoting. I am trying to pass in a IPrincipal
object to a .Net remote object but everytime I try I get an "Exception has
been thrown by the target of an invocation" error which goes into more
detail to tell me that:

System.Security.SecurityException: Request failed. at
System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor
secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet) at
System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info,
StreamingContext context) --- End of inner exception stack trace --- Server
stack trace: at
System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target,
SerializationInfo info, StreamingContext context) at
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object
obj, SerializationInfo info, StreamingContext context) at
System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
holder) at System.Runtime.Serialization.ObjectManager.DoFixups() at
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler
handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
methodCallMessage) at
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream
serializationStream, HeaderHandler handler, Boolean fCheck,
IMethodCallMessage methodCallMessage) at
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage(String
objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel
securityLevel) at
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IServerChannelSinkStack
sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
Stream& responseStream) Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg) at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type) at MYCODENAME


Is what I am trying even possible? If so, any ideas what I am doing wrong?
--
Gary A. Bushey
SPS MVP
bushey@mindspring.com


2 Answers

Ken Kolda

9/20/2004 10:10:00 PM

0

It looks like you're passing a WindowsPrincipal object to your server, which
is a Serializable object. When the object's embedded WindowsIdentity
instance is deserialized, you get the security exception. According to the
MSDN docs, deserializing a WindowsIdentity object requires ControlPrincipal
permission to be set. Is your server code running under a policy which does
not permit Principal Control (e.g. Internet or Local Intranet)?

Ken


"Gary A. Bushey [MVP]" <bushey@mindspring.com.REMOVETOSEND> wrote in message
news:%23RTCKX0nEHA.2096@TK2MSFTNGP15.phx.gbl...
> I am (very) new to .Net Remoting. I am trying to pass in a IPrincipal
> object to a .Net remote object but everytime I try I get an "Exception has
> been thrown by the target of an invocation" error which goes into more
> detail to tell me that:
>
> System.Security.SecurityException: Request failed. at
> System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor
> secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet) at
> System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info,
> StreamingContext context) --- End of inner exception stack trace ---
Server
> stack trace: at
> System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object
target,
> SerializationInfo info, StreamingContext context) at
>
System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Objec
t
> obj, SerializationInfo info, StreamingContext context) at
> System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
> holder) at System.Runtime.Serialization.ObjectManager.DoFixups() at
>
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
erHandler
> handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
> methodCallMessage) at
>
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
tream
> serializationStream, HeaderHandler handler, Boolean fCheck,
> IMethodCallMessage methodCallMessage) at
>
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage
(String
> objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel
> securityLevel) at
>
System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IS
erverChannelSinkStack
> sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
> requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
> Stream& responseStream) Exception rethrown at [0]: at
> System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
> reqMsg, IMessage retMsg) at
> System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
> msgData, Int32 type) at MYCODENAME
>
>
> Is what I am trying even possible? If so, any ideas what I am doing
wrong?
> --
> Gary A. Bushey
> SPS MVP
> bushey@mindspring.com
>
>


Gary A. Bushey [MVP]

9/20/2004 10:42:00 PM

0

It is running as a SharePoint Web Part which is basically a .Net Server
control. Don't suppose there is any way around it. I have a work-around
but it is quite a kludge.

--
Gary A. Bushey
SPS MVP
bushey@mindspring.com
"Ken Kolda" <ken.kolda@elliemae-nospamplease.com> wrote in message
news:em0ho61nEHA.3908@TK2MSFTNGP09.phx.gbl...
> It looks like you're passing a WindowsPrincipal object to your server,
> which
> is a Serializable object. When the object's embedded WindowsIdentity
> instance is deserialized, you get the security exception. According to the
> MSDN docs, deserializing a WindowsIdentity object requires
> ControlPrincipal
> permission to be set. Is your server code running under a policy which
> does
> not permit Principal Control (e.g. Internet or Local Intranet)?
>
> Ken
>
>
> "Gary A. Bushey [MVP]" <bushey@mindspring.com.REMOVETOSEND> wrote in
> message
> news:%23RTCKX0nEHA.2096@TK2MSFTNGP15.phx.gbl...
>> I am (very) new to .Net Remoting. I am trying to pass in a IPrincipal
>> object to a .Net remote object but everytime I try I get an "Exception
>> has
>> been thrown by the target of an invocation" error which goes into more
>> detail to tell me that:
>>
>> System.Security.SecurityException: Request failed. at
>> System.Security.SecurityRuntime.FrameDescSetHelper(FrameSecurityDescriptor
>> secDesc, PermissionSet demandSet, PermissionSet& alteredDemandSet) at
>> System.Security.Principal.WindowsIdentity..ctor(SerializationInfo info,
>> StreamingContext context) --- End of inner exception stack trace ---
> Server
>> stack trace: at
>> System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object
> target,
>> SerializationInfo info, StreamingContext context) at
>>
> System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Objec
> t
>> obj, SerializationInfo info, StreamingContext context) at
>> System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder
>> holder) at System.Runtime.Serialization.ObjectManager.DoFixups() at
>>
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Head
> erHandler
>> handler, __BinaryParser serParser, Boolean fCheck, IMethodCallMessage
>> methodCallMessage) at
>>
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(S
> tream
>> serializationStream, HeaderHandler handler, Boolean fCheck,
>> IMethodCallMessage methodCallMessage) at
>>
> System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryRequestMessage
> (String
>> objectUri, Stream inputStream, Boolean bStrictBinding, TypeFilterLevel
>> securityLevel) at
>>
> System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage(IS
> erverChannelSinkStack
>> sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream
>> requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders,
>> Stream& responseStream) Exception rethrown at [0]: at
>> System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
>> reqMsg, IMessage retMsg) at
>> System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
>> msgData, Int32 type) at MYCODENAME
>>
>>
>> Is what I am trying even possible? If so, any ideas what I am doing
> wrong?
>> --
>> Gary A. Bushey
>> SPS MVP
>> bushey@mindspring.com
>>
>>
>
>