In Sharepoint 2010, We created a web application with classic authentication and started developing it. Later, we want to implement forms authentication to our project, so I created a new sharepoint web application with form based authentication enabled. I took the backup of the old site(classic auth.) and restored to the new site(fba). I implemented forms authentication by following the below link.


I created a custom sign-in page. After entering valid credentials, user is not redirected to Home page. Authentication is happening properly but it not redirecting to the home page. When I click on login button, it is again loading the same login page. Please find the below code for authenticating and redirecting to home page

protected void btnLogin2_Click(object sender, EventArgs e)
  if(Membership.ValidateUser(txtUserId.Value, txtPassword.Value))
    string link = "http://ejudnam:36414/sites/Prototype/Dashboard/Pages/default.aspx");


    //I tried with the below line also but it is of no use
    // SPUtility.Redirect(link, SPRedirectFlags.Default, this.Context);

    lblMessage.Text = "Login Failed.";

We are unable to figure out the issue. I tried so many solutions but they are of no use. Your help will be highly appreciated.

Thank You.

  • Do you see any errors in the ULS logs that coincide with when you are attempting to log in? The FBA setup for SharePoint 2010 can be an error-prone process and I have found the ULS logs generally give a decent amount of information to troubleshoot the log in process. Commented May 28, 2012 at 12:45

3 Answers 3


Your custom login logic does not seem to set the FedAuth cookie:

SecurityToken token = SPSecurityContext.SecurityTokenForFormsAuthentication(
    new Uri(SPContext.Current.Web.Url),



If you get the login page again, then most likely there is a resource (image, list....) that you don't have sufficient permissions to view, on the page you're redirected to after logging in. As a result you're being redirected back to the login page.

Try making the user you're logging in as a site collection administrator, to see if it gets around this issue. If it does, then you have to find the offending resource and adjust the permissions on it.

Also, you mentioned you have a custom sign in page. Make sure that you can sign in properly with SharePoint's default sign in page - in case the custom sign in page is causing the issue.


Use Response.redirect( SpContext.current.site.url)

  • 1
    While this post may answer the question, we prefer more details such as "why". Please edit your post with additional details. See answer for general guidelines.
    – SPDoctor
    Commented May 25, 2012 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.