locked
Visual Studio 2013 - Identity - incorrect URLs RRS feed

  • Question

  • User556043096 posted

    Visual Studio 2013, using Identity account register/change password/login functions.

    When sending a "confirm" or "reset password" email, the URL in the email is correct when running within the Visual Studio IDE, but is incorrect for a published project.

    The URL comes through as "http://testsvr10/Account/ResetPassword?code....." but should be "http://testsvr10/projstatusexternal/Account/ResetPassword?code....", i.e. the top level folder name "projectstatusexternal" is missing.

    We are using the /Account/Forgot.aspx, /Account/ResetPassword.aspx, and /Account/Confirm.aspx that are provided with a new web project in Visual Studio 2013.

    We have coded a work around that alters the paths for the variables in the IdentityModel.vb, by passing in the correct top level folder name from a variable in the web.config. This works, but we would not expect to have to alter code in this file.

    The following snapshots show the url paths in the code.

    Monday, March 7, 2016 10:16 PM

Answers

  • User-166373564 posted

    Hi,

    For this 404.11 error message above, this is the cause of this issue below:

    The HTTP request to the Web server contains a double escape sequence. However, the Request Filtering feature is configured so that the Web server denies double escape sequences.

    To resolve this problem, please follow steps in the link below:

    https://support.microsoft.com/en-us/kb/942076 

    Regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 15, 2016 6:25 AM

All replies

  • User1124521738 posted

    try changing where the absoluteUri is generated to use https://msdn.microsoft.com/en-us/library/system.web.virtualpathutility%28v=vs.110%29.aspx

    VirtualPathUtility.ToAbsolute("~/Account/ResetPassword") rather than "/Account/ResetPassword"

    this way the URL will be based on the application path rather than an absolute hardcoded path which may not be valid when using application folders as you have found out.

    Monday, March 7, 2016 10:28 PM
  • User556043096 posted

    Hi there, thanks for the info!

    We've tried that now, however that brings up another issue, as shown below.

    Is there a different way to fix it?

    Cheers!

    Thursday, March 10, 2016 1:26 AM
  • User-166373564 posted

    Hi,

    For this 404.11 error message above, this is the cause of this issue below:

    The HTTP request to the Web server contains a double escape sequence. However, the Request Filtering feature is configured so that the Web server denies double escape sequences.

    To resolve this problem, please follow steps in the link below:

    https://support.microsoft.com/en-us/kb/942076 

    Regards,

    Angie

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, March 15, 2016 6:25 AM
  • User556043096 posted

    Thanks guys.

    The issue is now reversed. The URLs come through correctly in the published project but come through wrong when testing in Visual Studio.

    Any ideas?

    Thursday, April 7, 2016 11:30 PM