473,626 Members | 3,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom IPrincipal // Hacking the Application_Aut henticateReques t method // Something better in 2.0?


I've been reading this article:
http://msdn2.microsoft.com/EN-US/library/aa302401.aspx

Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication

(the article is for 1.1)
(i'm using 2.0)

The article is good. Then you get to the part about:::::::::: :::
protected void Application_Aut henticateReques t(Object sender, EventArgs e)
{
}
That you have to "hack in" a way to keep your custom IPrincipal alive and
well.

(I discovered this because when I did the following:
CustomPrincipal customPrinc = new CustomPrincipal (ident);
System.Web.Http Context.Current .User = customPrinc ;
then you went to the next page, the System.Web.Http Context.Current .User was
a GenericPrincipa l) and not an instance of CustomPrincipal like I would
expect.

.............

Is there a better way to handle this in 2.0, rather than hacking into the
Application_Aut henticateReques t method?

With the provider model in 2.0 I would expect something (similar) to:

<authenticati on mode= "MyCustomAuthen icator"/>

But no go on that.

There's gotta be a better way in 2.0 ?!?

Thanks!


Jun 27 '07 #1
0 1842

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

Similar topics

2
4973
by: Boris Condarco | last post by:
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...
6
4355
by: Tim Mulholland | last post by:
I have created my own IIdentity class (actually inherited from GenericIdentity) to contain lots of extra useful information to be passed around with the user's basic information. The class compiles fine, no problems there. My problem is that i'm not sure where to actually set this to be part of the HttpContext. I know that the IIdentity stuff is part of a principal (which in my case will be a GenericPrinciple i suppose since i'm using...
3
7248
by: David B. Bitton | last post by:
For some odd reason, despite the fact that I assign my own custom IPrincipal to the HttpContext.User property in an HttpApplication.AuthenticateRequest event handler inside of an IHttpModule, when I check the Page.User property, it's a WindowsPrincipal and not _my_ custom Iprincipal. Why would this be? .... using System;
2
4705
by: lucd | last post by:
Hello, I am currently playing with form authentication & role based security on a web application. As seen in the starter kit Time tracker, I setup a custom identity class (CustomPrincipal) because i wanted some extra info about the current user, i need this extra information to be available in pages without having
1
2630
by: Beren | last post by:
Hello With trial and error I'm attempting to create an extended identity to store some more data than just the Name, for example a Subscription and a LastSearchPerformed property... Is this a good idea ? I'm coming from ASP and Session variables, but I explicitly wanted to avoid that for .NET. The problem I'm facing is that I don't find a good way to bring my source
1
6318
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom soap header called by using a http module. The problem Im having is I cannot seem to get the event to raise to fire off my authenticate method in the global.asax. The module is plumbed in to my web.config file Code Below:-
1
1347
by: Enemaerke | last post by:
Hi I've searched through this newsgroup but have been unable to find something to answer my question so I'd better go ahead and post it We are currently developing a web service for processing requests on a business domain. We are interested in utilizing a custom authentication against a user database so we are looking into the WSE 3.0 scenarios and their samples. Once a user is authenticated the request is handled if the user has...
8
5281
by: Tomasz | last post by:
Hello Developers! I have an interesting problem using my custom MembershipProvider, RoleProvider and Forms Authentication. Both MembershipProvider and RoleProvider require session state, where some very important context data are stored during the Session_Start event. My MembershipProvider and RoleProvider depend on this information. It seems that authentication process works with no problems.
0
1793
by: sloan | last post by:
I'm working on a custom IPrincipal. Sometimes I use the "good ole" MS system of strings. Lately, I've been storing my roles and rights as Guids. Check out the below code. I'm not sure if this is the way to go or not.
0
8262
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.