473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Custom Role Based Security

Hi gurus,

I was reading some documentation about security in .NET Framework, it
mention that it is possible to make custom Role Based security for example:
check the authentication with Windows Integrated and once do that, create a
Generic Identity in orde to create a Generic Principal with custom roles for
that user. Finally, replace the current Principal to the new Generic
Principal.

Is it possible to do this in an ASP.NET application?, If yes, Does someone
of you can share a little code?, i would really apreciate it... :-)

Thanks in advance.

Boris.
Nov 18 '05 #1
2 4960
Look at
"Designing Application-Managed Authorization"
http://msdn.microsoft.com/library/de...html/damaz.asp
Basically set the HttpContext.Current.User to you own IPrincipal
implementation in Global.asax Application_AuthenticateRequest method.

/Michel

Boris Condarco wrote:
Hi gurus,

I was reading some documentation about security in .NET Framework, it
mention that it is possible to make custom Role Based security for example:
check the authentication with Windows Integrated and once do that, create a
Generic Identity in orde to create a Generic Principal with custom roles for
that user. Finally, replace the current Principal to the new Generic
Principal.

Is it possible to do this in an ASP.NET application?, If yes, Does someone
of you can share a little code?, i would really apreciate it... :-)

Thanks in advance.

Boris.


Nov 18 '05 #2
You can definitely perform impersonation in ASP.NET. There are a few
ways to do it. Which approach fits you depends on what level of
security you need.

1. Turn on "Basic authentication" on your virtual directory through
IIS.
Turn on impersonation in your ASP.NET web application through
Web.Config.

2. Use a mix of .NET Framework and Windows API to authenticate the
user's
identity.
Use a mix of .NET Framework and Windows API to check if the user
has
authorization to the resource.

3. Combine "Basic Authentication", a custom ISAPI filter, and Active
Directory
to authenticate and authorize user's access to resources.

Option #1 requires no code in your part, but it is the least security
approach.

Option #2 requires requires coding with the .NET Framework and Windows
API, but is not too bad. The ASP.NET newsgroup will have plenty of
examples code sample.

Option #3 is the most secure approach among all the options. However,
It requires a lot of coding, especially with the ISAPI filter sinces
it needs to be written in C++.

Tommy,

"Boris Condarco" <bc*******@hotmail.com> wrote in message news:<O4**************@TK2MSFTNGP12.phx.gbl>...
Hi gurus,

I was reading some documentation about security in .NET Framework, it
mention that it is possible to make custom Role Based security for example:
check the authentication with Windows Integrated and once do that, create a
Generic Identity in orde to create a Generic Principal with custom roles for
that user. Finally, replace the current Principal to the new Generic
Principal.

Is it possible to do this in an ASP.NET application?, If yes, Does someone
of you can share a little code?, i would really apreciate it... :-)

Thanks in advance.

Boris.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: ChrisB | last post by:
Hello: I am a member of a team creating a .NET application, and we seem to have run into an issue when trying to implement role based security. Our application makes use of a fairly common...
0
by: andrew lowe | last post by:
Hi We have windows application and have created our own custom principle & identity objects that implement IPrinciple and IIdentity. When a user logs into our system we set the threads principle...
5
by: Ben R. | last post by:
My website uses a custome membership and role provider. I can use a custom login control and user creation control and can debug my providers while doing so with breakpoints. However, when I launch...
3
by: charles | last post by:
Hi, I am trying to port my ASP application to ASP.Net 2.0 My application is sold to large corporations that have many thousands of users. So I do not use Forms authentication. To make it more...
7
by: nugget | last post by:
Role-based security for an ASP/ASP.NET mixed environment Hello: My co-worker and I have been charged with designing role-based security for our intranet. The technologies we have to work with...
3
by: Sid DeLuca | last post by:
I am developing a smart client application that I intend to use role-based authentication using X509 certificates. That is, each client would have a certificate that would uniquely identify them,...
1
by: Jakob Lithner | last post by:
When I started a new ASP project I was eager to use the login facilities offered in Framework 2.0/VS 2005. I wanted: - A custom principal that could hold my integer UserID from the database -...
5
by: Alias | last post by:
Hi - I'm trying to implement a custom RoleProvider based on the SqlRoleProvider. I keep receiving a an error that it can't load type 'MyRoleTest.MyRoleProvider' when trying to load my...
4
by: =?Utf-8?B?bmVlcmFqYkBub2lkYS5ub3NwYW1oY2x0ZWNoLmNv | last post by:
Hi, I have a question with respect to the security implementation of Menu using sitemap. Normally in the sitemap we can implement role based security but that is based on the Role based...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.