none
Form Authendication issue while redirecting to Sharepoint site in asp.net RRS feed

  • Question

  • Hi,

      I had configured form Authentication for my sharepoint site and iam able to login successfully with the

    credentials my issue is after login successfully if i redirect to that particular sharepoint site it is again asking for credential

    how can i avoid this and if i check the cookie in the browser the cookie will be lost my asp.net application is in my machine(localhost) and the sharepoint is in different server .

    Authentication.Authentication authSvc = new Authentication.Authentication(); authSvc.CookieContainer = new System.Net.CookieContainer(); authSvc.AllowAutoRedirect = true; LoginResult result = authSvc.Login(TextBox1.Text,TextBox2.Text); if (result.ErrorCode == LoginErrorCode.NoError) { CookieCollection cookies = authSvc.CookieContainer.GetCookies(new Uri(authSvc.Url)); Cookie authCookie = cookies[result.CookieName];

      HttpCookie myCookie = new HttpCookie(result.CookieName);
           myCookie.Value = authCookie.Value;       Response.Cookies.Add(myCookie);
          Response.Cookies[result.CookieName].Value = authCookie.Value; response.Redirect("http://ServerSharepoint:7000/sites/New"); //Redirecting from local machine to sharepoint








    • Edited by sajithtgs Wednesday, December 26, 2012 12:26 PM
    Wednesday, December 26, 2012 5:00 AM