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
509 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now