Can't configure security for client side control

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Can't configure security for client side control

    I've created a Windows.Forms control and placed it on an aspx page with the
    <object> tag and verified that it works nicely. But, when I add
    functionality to it (specifically, stuff from system.net.sockets) I get a
    security policy violation. I've followed the instructions given at
    [url]http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx[/url], but I
    can't get it to work at all. I add a permission set, add a code group,
    point it at my assembly via the strong name, etc... It works fine in a
    standalone app, but I can't get past security when the control is on a web
    page. Any suggestions?


    0to60 Guest

  2. Similar Questions and Discussions

    1. Modify datagrid control on client side
      Hello to all, I am using Visual Studio 2005 now. Is there an example out there where one can see a Microsoft Datagrid control being modified on...
    2. Client side event for datagrid control
      This is probably a simple one, but I cannot seem to find an example. I have a datagrid with each row containing Checkbox | Textbox |...
    3. Client-Side Script for CheckBox Web Control
      I'm trying to create a server Web control that renders as a checkbox that has an OnClick event associated with it. I've created a short proof of...
    4. ASP.Net and client side control (SelectedIndexChanged)
      I was wondering what capabilities ASP.Net has at the client level. I have been using a RadioButtonList. My control and additional textboxes...
    5. How to configure a SOAP extension to run on the client side?
      Hi, this is actually quite simple. The best and easiest approach is to configure it in the application's .config file. Just like this:...
  3. #2

    Default RE: Can't configure security for client side control

    Are you sure the code is executing in the group you specified? Under what
    node in the code groups tree did you create the new group? What condition
    type did you choose? I have done the exact thing you are trying but instead
    of using StrongName, I used url which worked.

    More than likely the code is not executing it the group you think.

    "0to60" wrote:
    > I've created a Windows.Forms control and placed it on an aspx page with the
    > <object> tag and verified that it works nicely. But, when I add
    > functionality to it (specifically, stuff from system.net.sockets) I get a
    > security policy violation. I've followed the instructions given at
    > [url]http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx[/url], but I
    > can't get it to work at all. I add a permission set, add a code group,
    > point it at my assembly via the strong name, etc... It works fine in a
    > standalone app, but I can't get past security when the control is on a web
    > page. Any suggestions?
    >
    >
    >
    tom wisnowski Guest

  4. #3

    Default Re: Can't configure security for client side control

    "tom wisnowski" <tomwisnowski@discussions.microsoft.com> wrote in message
    news:56D7B52F-A252-49E0-BACC-B72F3DFEF608@microsoft.com...
    > Are you sure the code is executing in the group you specified? Under what
    > node in the code groups tree did you create the new group? What condition
    > type did you choose? I have done the exact thing you are trying but
    instead
    > of using StrongName, I used url which worked.
    >
    > More than likely the code is not executing it the group you think.
    I created the code group under Machine->IntranetZone. Does that make a
    difference? How exactly do I say which zone my code will apply to? I
    thought that was all controlled by the membership specifics for that code
    group, i.e. if it has a strong name of such and such, it will be run under
    this code group. Is that not so?

    Furthermore, when I ran the Evaluate an Assembly util on my assembly, it
    came back "unrestriced access". That kinda makes sense, because if I
    created an assembly for a standalone .exe, it would be able to pretty much
    do anything. If I look at it that way, it SHOULD be unrestricted. But on a
    web page, it SHOULD have more security. How can I see the difference?


    0to60 Guest

  5. #4

    Default RE: Can't configure security for client side control

    Try something like this to look at the evidence the assembly is executing with:


    public void GetEvidence()
    {
    IEnumerator enumerator =
    Assembly.GetExecutingAssembly().Evidence.GetEnumer ator();
    while(enumerator.MoveNext())
    {
    object o = enumerator.Current;
    //try cast to type of evidence object...
    switch(o.GetType().Name)
    {
    case "Group":
    CodeGroup g = (Group)o;
    //g.Name;
    break;
    case "Site":
    Site s = (Site)o;
    //s.Name;
    break;
    case "Url":
    Url u = (Url)u;
    //u.Value;
    break;
    //etc.....
    }
    }
    }

    you could call a function to return the group names that you could call from
    javascript, then write the names on the client UI for debugging purposes.
    (You could also use Debug.WriteLine and use Dbmon or DebugView on the client
    as well).

    Hope this helps!

    "tom wisnowski" wrote:
    > Are you sure the code is executing in the group you specified? Under what
    > node in the code groups tree did you create the new group? What condition
    > type did you choose? I have done the exact thing you are trying but instead
    > of using StrongName, I used url which worked.
    >
    > More than likely the code is not executing it the group you think.
    >
    > "0to60" wrote:
    >
    > > I've created a Windows.Forms control and placed it on an aspx page with the
    > > <object> tag and verified that it works nicely. But, when I add
    > > functionality to it (specifically, stuff from system.net.sockets) I get a
    > > security policy violation. I've followed the instructions given at
    > > [url]http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx[/url], but I
    > > can't get it to work at all. I add a permission set, add a code group,
    > > point it at my assembly via the strong name, etc... It works fine in a
    > > standalone app, but I can't get past security when the control is on a web
    > > page. Any suggestions?
    > >
    > >
    > >
    tom wisnowski Guest

  6. #5

    Default Re: Can't configure security for client side control

    That is partly true, it does resolve group membership via evidence. The
    system first resolves the top level group mebership, ie internet, intranet,
    etc. Once inside a group it looks at the sub groups at that level and thier
    membership conditions. The system will execute the code in the group that has
    a condition that matches the assembly's evidence. This process of searching
    for group membership is recursivley repeated until the assembly does not
    qualify for any sub group at a particular level. Once this condition is met,
    the code executes in the group at the current search level.



    "0to60" wrote:
    > "tom wisnowski" <tomwisnowski@discussions.microsoft.com> wrote in message
    > news:56D7B52F-A252-49E0-BACC-B72F3DFEF608@microsoft.com...
    > > Are you sure the code is executing in the group you specified? Under what
    > > node in the code groups tree did you create the new group? What condition
    > > type did you choose? I have done the exact thing you are trying but
    > instead
    > > of using StrongName, I used url which worked.
    > >
    > > More than likely the code is not executing it the group you think.
    >
    > I created the code group under Machine->IntranetZone. Does that make a
    > difference? How exactly do I say which zone my code will apply to? I
    > thought that was all controlled by the membership specifics for that code
    > group, i.e. if it has a strong name of such and such, it will be run under
    > this code group. Is that not so?
    >
    > Furthermore, when I ran the Evaluate an Assembly util on my assembly, it
    > came back "unrestriced access". That kinda makes sense, because if I
    > created an assembly for a standalone .exe, it would be able to pretty much
    > do anything. If I look at it that way, it SHOULD be unrestricted. But on a
    > web page, it SHOULD have more security. How can I see the difference?
    >
    >
    >
    tom wisnowski Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139