?
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
Medium Priority
?
519 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

777 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