473,498 Members | 891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IPriciple implementaion

8 New Member
hello,

I was wondering if creating a custom Ipriciple is not going to hurt performance of my application. I was debugging my code and it seems that on every request my principle object is recreated. in other words i am having to access AD on eah request. can someone tell me if this is the right approach?

Expand|Select|Wrap|Line Numbers
  1.  void Application_AuthenticateRequest(Object sender, EventArgs e)
  2.     {
  3.        if (Request.IsAuthenticated == true  && this.User != null)
  4.         {
  5.             //Construct SecurityManager with AD path passed in from web config.
  6.             SOLARBusinessLayer.SecurityManager objSec = new SOLARBusinessLayer.SecurityManager();
  7.             objSec.ADPath = ConfigurationManager.ConnectionStrings["ADConnectionString"].ToString();
  8.             objSec.ADUserName = ConfigurationManager.AppSettings["USERNAME"].ToString();
  9.             objSec.ADPassword = ConfigurationManager.AppSettings["PWD"].ToString();     
  10.             //Create a CustomPrincipal for the current user.
  11.             SOLARBusinessLayer.SolarPrincipal cprPrincipal = objSec.ConstructCustomPrincipal(this.User.Identity);
  12.             //Replace the GenericPrincipal in the HttpContext for the current request.
  13.             this.Context.User = cprPrincipal;
  14.         }
  15.     }
Feb 19 '08 #1
0 715

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1466
by: Adrian Herscu | last post by:
Hi all, During the COM age, Microsoft's policy was against implementation inheritance. Now, it turns 180 degrees and all the .NET Framework relies heavily on implementation inheritance. What's...
4
1194
by: alex_gilboa | last post by:
Can anybody point me to some jsmock implementation? My attempt to google it failed :(
5
2014
by: RAM | last post by:
hi, is any body implemented unix cp command . if so please share it regards
2
1093
by: jsh02_nova | last post by:
Has anybody ever used custom attributes to implement a custom interface for a user defined type? thx -jsh
1
1584
by: Raf256 | last post by:
I have base template class A<B>, and son class B. Inside A<B> constrcutor, can I access a pointer to B, from "this"? like A<B>::A() : pointerToB(static_cast<B*>this) { } I will use the...
15
7549
by: shuisheng | last post by:
Dear All, Assume I have a class named Obj. class Obj { }; And a class named Shape which is derived from Obj. class Shape: public Obj
2
9730
by: zaheerleo | last post by:
hi guyz: can u give me the code or algorithms for First Come First Serve, Rand-Robin, Shortest Job First and Priority Algo CPU scheduling techniques
2
801
by: syammohan | last post by:
In my ASP page, the list box is not pertaining the value in postback. How I can solve this using AJAX. Thanks in advance for your helo. Very urgent.
2
1162
by: anjummir | last post by:
I have one challenge here. lets say we have one web app opened with an authentication ticket(IPriciple implement) in one browser. lets call it browser A. Now from browser A client opens up another...
0
7124
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
6998
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
7200
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...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
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 ...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.