I've created my own AzureIdentityProvider script in the owin.IdentityProviders configuration, and I'm trying to make the redirect URL and post-login redirect URL more dynamic, based on the URL it's being fired from. I've tried using the Request.ServerVariables to get the HTTP_HOST (null, as are most of the server variables), or HttpContext.Current.Request.Url.Host (returns regardless of my local IIS or my Azure PaaS), or Sitecore.Context.Site.TargetHostName (Sitecore.Context.Site is null).

This pipeline seems to be fired very early in the process, I'm guessing by design, though I'm using it for an external login, not the Sitecore shell. This was originally done for a 9.0.1 site when federated authentication was new, but we upgraded to 9.3 recently. Beyond trying this trick, everything works fine if we just preset the values in the config.

Is this a pipeline that can be moved and fired a bit later to get the server variables or Sitecore context, or is this one more immutable and we need to find another way to handle this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.