public override bool Configure(ITaskContext taskContext)
        {
            if (!base.Configure(taskContext))
            {
                return(false);
            }
            string intraOrganizationConnectorName = this.GetIntraOrganizationConnectorName();
            IntraOrganizationConnector intraOrganizationConnector = taskContext.OnPremisesSession.GetIntraOrganizationConnector(intraOrganizationConnectorName);

            if (intraOrganizationConnector != null)
            {
                taskContext.OnPremisesSession.RemoveIntraOrganizationConnector(intraOrganizationConnectorName);
            }
            IntraOrganizationConnector intraOrganizationConnector2 = taskContext.TenantSession.GetIntraOrganizationConnector(intraOrganizationConnectorName);

            if (intraOrganizationConnector2 != null)
            {
                taskContext.TenantSession.RemoveIntraOrganizationConnector(intraOrganizationConnectorName);
            }
            IntraOrganizationConfiguration intraOrganizationConfiguration  = taskContext.OnPremisesSession.GetIntraOrganizationConfiguration();
            IntraOrganizationConfiguration intraOrganizationConfiguration2 = taskContext.TenantSession.GetIntraOrganizationConfiguration();

            taskContext.OnPremisesSession.NewIntraOrganizationConnector(this.GetIntraOrganizationConnectorName(), intraOrganizationConfiguration2.OnlineDiscoveryEndpoint.ToString(), intraOrganizationConfiguration2.OnlineTargetAddress, true);
            taskContext.TenantSession.NewIntraOrganizationConnector(this.GetIntraOrganizationConnectorName(), intraOrganizationConfiguration.OnPremiseDiscoveryEndpoint.ToString(), intraOrganizationConfiguration2.OnPremiseTargetAddresses, true);
            if (!taskContext.Parameters.Get <bool>("_suppressOAuthWarning"))
            {
                base.AddLocalizedStringWarning(HybridStrings.WarningOAuthNeedsConfiguration(Configuration.OAuthConfigurationUrl(taskContext.HybridConfigurationObject.ServiceInstance)));
            }
            return(true);
        }