Hi,

in this example

Dim ident As New GenericIdentity("Bob")
Dim prpal As New GenericPrincipal(ident, New String() {"Level1"})

I create a Bob user, but if I want to create a Principal object by a
WindowsFormAuthentication (with User and Password), I don't want to be
able to create a Principal object by code, because someone could violate
my application. Therefore I want to prevent that someone creates a Bob
user or others user by code, how can I do it? I want to make this in a
client/server application and not in ASP.NET

I want to receive a SecurityException if I try to create the user Bob by
code.

I want that these lines code:

Dim ident As New GenericIdentity("Bob")
Dim prpal As New GenericPrincipal(ident, New String() {"Level1"})

Throw me a SecurityException, because the user must be create always with
the WindowsFormAuthentication.

The problem is that the methods of my assembly are signed with Declarative
Security (Attribute that accept a user); so someone could be access to
this assembly if he creates a client and then creates an Identity by code:
I want to prevent this.

TIA,
Diego Parolin

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to