1

I am having an issue in Sitecore where when I try to redirect to a particular page from within a Controller, it takes me to the home URL of the website instead of the path that I am specifying.

This is the code for the redirect

[HttpPost, ValidateAntiForgeryToken]
public ActionResult ClaimantLogin(ClaimantLogin viewModel) 
{
    // other processing code here
    return Redirect($"{_claimantDashboardPageUrl}{viewModel.QueryString}");
}

I have confirmed that this code is hit when I run in my local environment. The odd thing is that this works when run in a testing environment on the Delivery instances but has the issue when run on the Authoring or Standalone instances leading me to suspect something is happening with the configuration.

Any ideas what this could be as nothing in particular stands out to me?

4
  • Are there any errors or warning in the logs? Aug 4, 2023 at 17:24
  • In the failing environment, if you manually enter the redirect destination into url does it show correctly? Also, is there any difference if you do this in an incognito browser? Aug 5, 2023 at 5:32
  • Manually hitting the URL works fine, there do not appear to be any errors contained in the logs Aug 6, 2023 at 23:49
  • The issue appears to be caused due to federated authentication on Standalone or CM instances, this somehow impacts redirect functionality Aug 7, 2023 at 4:09

1 Answer 1

0

I also encountered the exact same issue on a Sitecore XP 10.3.1 Scaled CD server.

As mentioned by Matthew Pigram, the issue was due to federated authentication being enabled. By activating the \App_Config\Include\Examples\Sitecore.Owin.Authentication.Disabler.config.example on the CD server, the redirect started to redirect to the URL in the argument.

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.