Last post Sep 19, 2014 12:51 AM by RagavanB
Sep 18, 2014 01:54 AM|RagavanB|LINK
I have my web application(developed using vs2013,webforms,MS Owin authentication) deployed in
another system' IIS. The problem is, when i tried to login to that application in other computers in LAN, After giving login credentials it redirects to itself(login page) instead of index.aspx. but if I access that application in my developing machine
it works fine to redirects to index after login. but not in other systems. why this problem occurs. the url looks like [
when I try again, it still shows the same url and redirects to same login page. Pls help me to find solution.
[ If you want code snippet of specific portion pls let me know ]
Sep 18, 2014 02:21 AM|bethsedea|LINK
Can you try adding this line after login is authenticated:
and also check if the PostBackUrl="" on your aspx code, if it is set to the right page, or if it was ever used.
Hope this helps :)
Sep 18, 2014 02:48 AM|RagavanB|LINK
Thanks for rly Bethsedea.
my login code
protected void LogIn(object sender, EventArgs e)
// Validate the user password
var manager = new UserManager();
ApplicationUser user = manager.Find(UserName.Text, Password.Text);
if (user != null)
IdentityHelper.SignIn(manager, user, RememberMe.Checked);
FailureText.Text = "Invalid username or password.";
ErrorMessage.Visible = true;
am also tried response.redirect("xxxxx"); here IdentityHelper is a model class by asp.net have methods for signin and redirect.
the redirect works in 2 systems well. but not in others. i don't knw why.
Sep 18, 2014 03:27 AM|bethsedea|LINK
Yes! you're welcome, I encountered same problem before, but it was because I overlooked my ASP code.
<asp:LinkButton ID="lblDef" runat="server" CausesValidation="False"
^you will have to remove that code.
even when you use redirect, the post back url still takes over even when you put a code behind. :)
Sep 18, 2014 04:04 AM|RagavanB|LINK
In my login form, no postbackURL specified. bcz it is simple form using text boxes and a asp:button to submit the form. No login control used. Why the confusion is, bcz it works fine in 2 systems but not in others. I have the following doubts?
> Is this is occurs, bcz of any IIS setting. (but i checked all and can't find any bug)
> Is this by Owin Startup method, which redirects to Account/Login if user not authenticated.
My web.cofig authentication xml:
Sep 19, 2014 12:51 AM|RagavanB|LINK
the problem is there is an explicit response redirection after login. but MS Owin authentication automatically redirects to index.aspx after successful login.
when another redirection tries to redirect, http returns 302 status code. I tried commenting that Response.Redirect in IdentityHelper class, then it works fine.