Solved

When using global.asax, when should you access database to gather user information if using integrated windows auth.

Posted on 2006-06-15
1
514 Views
Last Modified: 2011-09-20
Hello,

This is sort of an extension to my question here: http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21887299.html

Basically, i am using windows authentication.  When a user accesses the site i want to grab their information, go to the database, and see if their windows account is in the idsid or not.


so where should i do this?  in init()?  or where?

please keep in mind that i also have this code:

void WindowsAuthentication_Authenticate( object s, WindowsAuthenticationEventArgs e ) {
      e.User = new GenericPrincipal( e.Identity, (string[])(colRoles[e.Identity.Name.ToLower()]));
}
0
Comment
Question by:alexthecodepoet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 6

Accepted Solution

by:
Nandakumar Sakthivel earned 500 total points
ID: 16910601
Hi,
  I am not very much clear about your query.But as per my understanding i think that you want  to enable windows authentication for your application and need to track the windows userid with your existing userid values in the database.

 In that case you can validate that in the pageload event itself
Including the following code
      system.web.ui.page.User.Identity.Name  
will return you the value as <domainname>\<userid> format provided that windows authentication is enabled in your application.Using the <userid> you can do your validations

Thanks,
Nanda
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question