I have integrated Federated Authentication.

After user is authenticated, I want to redirect to another page instead of dashboard page.

So, on which pipeline can I write that logic where I can get Sitecore.Context.User.IsAuthenticate true before redirecting to dashboard page?

2 Answers 2


As per the Sitecore documents you must create a new processor for the owin.identityProviders pipeline. To create a new processor:

  1. Inherit the Sitecore.Owin.Authentication.Pipelines.IdentityProviders.IdentityProvidersProcessor class.

  2. Override the IdentityProviderName property with the name you specified for the identityProvider in the configuration.

  3. Override the ProcessCore method.

Ref: https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-manager/configure-federated-authentication.html

And in the ProcessCode method, you can add the parameters something like this.

public class AzureADIdentityProviderProcessor : IdentityProvidersProcessor
   public AzureADIdentityProviderProcessor(FederatedAuthenticationConfiguration federatedAuthenticationConfiguration, ICookieManager cookieManager, BaseSettings settings) : base(federatedAuthenticationConfiguration, cookieManager, settings)

  protected override void ProcessCore(IdentityProvidersArgs args)
       Assert.ArgumentNotNull(args, nameof(args));

       var identityProvider = this.GetIdentityProvider();
       var authenticationType = this.GetAuthenticationType();
       var saveSigninToken = identityProvider.TriggerExternalSignOut;

       var targetHostName = GetTargetHostName();
       string aadInstance = "https://login.microsoftonline.com/{0}/";
       string tenant = Settings.GetSetting("Foundation.Accounts.SSO.AD.Tenant");
       string clientId = Settings.GetSetting("Foundation.Accounts.SSO.AD.ClientId");
       string clientSecret = Settings.GetSetting("Foundation.Accounts.SSO.AD.ClientSecret");
       string postLogoutRedirectURI = $"{targetHostName}{Settings.GetSetting("Foundation.Accounts.SSO.AD.PostLogoutRedirectURI")}";
       string redirectURI = $"{targetHostName}{Settings.GetSetting("Foundation.Accounts.SSO.AD.RedirectURI")}";
       string scope = Settings.GetSetting("Foundation.Accounts.SSO.AD.Scope");

And add the pipeline here.

     <processor type="Foundation.Accounts.Services.AzureActiveDirectory.AzureADIdentityProviderProcessor, Foundation.Accounts" resolve="true" />

Under this method you can add the provider for RedirectToIdentityProviderAsync like this.

Notifications = new OpenIdConnectAuthenticationNotifications
                RedirectToIdentityProvider = this.RedirectToIdentityProviderAsync,
                SecurityTokenValidated = this.SecurityTokenValidatedAsync

And add the method like below.

private Task RedirectToIdentityProviderAsync(
        RedirectToIdentityProviderNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions>
   // logic

Refer to these documents for the whole implementation.



Hope this will work for you.

  • If I will redirect directly from IdentityProvider then Sitecore.Context.User.IsAuthenticate will not be true
    – Bhawana
    May 25 at 10:14
  • Updated my answer. refer to the articles I have shared. May 25 at 10:58
  • RedirectToIdentityProvider calls at the time of Authentication/Logout/Token not after,where I can access IsAuthenticate
    – Bhawana
    May 26 at 1:54
  • @Bhawana Did you check the second article I have given where they are checking the authentication in this condition? protocolMessage.RequestType == OpenIdConnectRequestType.Authentication May 26 at 6:23
  • Yes I checked in OpenIdConnectRequestType.Authentication, it will give IsAuthenticated as true in second time, not the first time. I just want to know the pipeline where Sitecore set Sitecore.Context.User.IsAuthenticated as true
    – Bhawana
    May 26 at 16:16

There are 2 pipelines you can try out to patch your custom processor.

  1. loggedin
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
                <processor patch:before="processor[position()=last()]" method="Process"  mode="on" type="YourCustomProcessor, YourAssembly" resolve="true"/>
  1. owin.cookieAuthentication.signedIn - If you are using an identity server for federated authentication this pipeline should work fine.
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
        <processor  patch:before="*[@type='Sitecore.Owin.Authentication.Pipelines.CookieAuthentication.SignedIn.CreateTicket, Sitecore.Owin.Authentication']"
            type="YourCustomProcessor, YourAssembly" resolve="true"/>

Hope it helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.