Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I've done a similar thing to you: authenticating users from a legacy ASP application to an ASP.NET site. What would help, is if you could provide a little more detail (sample code, perhaps) of the process you've setup to do this with users coming from the legacy app to the ASPX app.</p> <p>To give you a brief idea, in my implementation I've done the following:</p> <ul> <li>Create an .ASPX page</li> <li>The .ASPX page accepts HTTP POST values from a particular legacy ASP app <em>only</em>.</li> <li>When a POST request is received, I extract the username/password values, then proceed to authenticate in the normal way. If the user is successfully authenticated, we issue a FormsAuthentication cookie to the user.</li> </ul> <p>In reality, my implementation is quite a bit more complicated, using the database as a backing store (as both apps share a common data source) and a particular database field to store a random code which is sent from the classic app to the .NET side to further verify that the request received by the .NET app is valid.</p> <p><strong>EDIT:</strong></p> <p>Try manually setting your authentication cookie. Delete the line:</p> <pre><code>FormsAuthentication.SetAuthCookie(Request.QueryString["uid"], false); </code></pre> <p>Replace with:</p> <pre><code>FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, Request.QueryString["uid"], DateTime.Now, DateTime.Now.AddHours(24), false, null) string encryptedTicket = FormsAuthentication.Encrypt(ticket); HttpCookie cookie = new HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket); HttpContext.Current.Response.Cookies.Add(cookie); </code></pre> <p>See how you get on with that?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload