public PackageInfoDto GetPackageDetail(int portalId, PackageInfo package)
        {
            var authSystem = AuthenticationController.GetAuthenticationServiceByPackageID(package.PackageID);
            var detail     = new AuthSystemPackageDetailDto(portalId, package)
            {
                AuthenticationType = authSystem.AuthenticationType,
            };

            var isHostUser = UserController.Instance.GetCurrentUserInfo().IsSuperUser;

            if (isHostUser)
            {
                detail.ReadOnly             |= authSystem.AuthenticationType == "DNN";
                detail.LoginControlSource    = authSystem.LoginControlSrc;
                detail.LogoffControlSource   = authSystem.LogoffControlSrc;
                detail.SettingsControlSource = authSystem.SettingsControlSrc;
                detail.Enabled = authSystem.IsEnabled;
            }

            LoadCustomSettings(portalId, package, authSystem, detail);
            return(detail);
        }
        private static void LoadCustomSettings(int portalId, PackageInfo package, AuthenticationInfo authSystem, AuthSystemPackageDetailDto detail)
        {
            var hasCustomSettings = !string.IsNullOrEmpty(authSystem.SettingsControlSrc);

            if (hasCustomSettings)
            {
                detail.SettingUrl = GetSettingUrl(portalId, package.PackageID);
            }

            // special case for DNN provided external authentication systems
            switch (detail.AuthenticationType.ToLowerInvariant())
            {
            case "facebook":
            case "google":
            case "live":
            case "twitter":
                var config = OAuthConfigBase.GetConfig(detail.AuthenticationType, portalId);
                if (config != null)
                {
                    detail.AppId      = config.APIKey;
                    detail.AppSecret  = config.APISecret;
                    detail.AppEnabled = config.Enabled;
                }
                break;
            }
        }