Thursday, April 16, 2009

Migraine Headachescondition_symptoms

authenticate code

I happened recently to receive from another web page of an intranet credentials of the logged in user. My problem was and then use this user (I was obviously given the password) as IPrincipal of my web app.
Here's what I found:
if (! This.User.Identity.IsAuthenticated) {
FormsAuthentication.SetAuthCookie (userName, false);
Response.Redirect (this.Request.FilePath, true);}

To test I put it in the Page_Load () but it certainly would be better off in a IHttpModule.

0 comments:

Post a Comment