Solved

Change Password - Form Authentication,ASP.NET

Posted on 2011-03-25
4
558 Views
Last Modified: 2012-05-11
Hi,
I am using Login Control - Form Authentication in my application.
Autheticating users using Custom function using LDAP for Active Directory.
Every thing works perfectly fine.

Now, i have created a forgotPassword.aspx page and added a PasswordRecoveryURL& PasswordRecoveryText on the Login control.... expecting whenver user cliks on "Forgot password".. should be taken to that page .
But,..it still hangs on at Login.aspx page expecting user to provide login credentials ....after that it takes to "forgot passoword" page.

How can i directly go to ForgotPassword.aspx page .

ASP.net 2.0, C#.net
(Note:- Not using Memebrship)

(pls find the code for Ref)

Web.Config
----------
<authentication mode="Forms" >
			<forms loginUrl="login.aspx" name="adAuthCookie" timeout="60" path="/">
			</forms>
		</authentication>

--------------------------------------------------------------

Login.aspx
**********
if (e.Authenticated )
{
  Session["UserID"] = Login2.UserName;                     
  string groups = adAuth.GetGroups();
  FormsAuthenticationTicket authTicket = new  FormsAuthenticationTicket(1, Login2.UserName, DateTime.Now, DateTime.Now.AddMinutes(60), false, groups);
                      string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
                      HttpCookie authCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket);
                      Response.Cookies.Add(authCookie);

Open in new window

0
Comment
Question by:kishan66
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:nbove
Comment Utility
The following link provides examples and sample code for using Forms Authentication and connecting to Active Directory.  If you are having difficulty, try modifying your code to more closely match the examples.

http://msdn.microsoft.com/en-us/library/ff650308.aspx
0
 

Author Comment

by:kishan66
Comment Utility
Hi nbove,

Thanks for th ereply.

As mentioned ,I dont have any dificulty in Authenticating user accross ActiveDirectory.

Difficulty:- Forgot Password
From Login.aspx, upon clicking on "Forgot Password", i am not being transferd to the page(forgotPassword.aspx)...
rather i'm being redirected to Login.aspx as i'm using formAuthentication(pls correct me if wrong).

So, is there any way i can make forgotpassword.aspx page as -- No authentication required
0
 
LVL 7

Accepted Solution

by:
nbove earned 500 total points
Comment Utility
Look into using a location element block in your web.config.  Here is an example:
<location path="ManageUsers/ForgotPassword.aspx" allowOverride="false">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

Open in new window

0
 

Author Comment

by:kishan66
Comment Utility
You guys Rock again :-)

Thanks for the help nbove.
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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

6 Experts available now in Live!

Get 1:1 Help Now