/// <summary> /// Imports the specified file containing an XML configuration of the SSO application. /// </summary> /// <param name="filePath">Import file path.</param> /// <param name="overrideApp">Value indicating whether to override the application if it already exists.</param> /// <returns><b>true</b> if the application imported successfully; otherwise <b>false</b>.</returns> public static bool ImportApplication(string filePath, bool overrideApp) { // load the app configuration from the file SSOAppConfig appConfig = XmlSerializationUtil.LoadXml <SSOAppConfig>(filePath); // check if the application already exists if (SSOManager.ApplicationExists(appConfig.AppInfo.Name) == true) { if (overrideApp == true) { // update/recreate the application SSOManager.UpdateApplication(appConfig, true); } else { return(false); } } else { // create a new application SSOManager.CreateApplication(appConfig); } return(true); }
public static void UpdateApplicationFields(string appName, SSOAppFieldCollection appFields, bool recreate) { if (recreate == true) { SSOAppConfig appConfig = new SSOAppConfig() { // load the current application metadata information AppInfo = SSOManager.GetApplicationInfo(appName), // and use the application fields provided AppFields = appFields }; // update/recreate the application including the fields SSOManager.UpdateApplication(appConfig, true); } else { // just update the application fields ISSOConfigStore ssoConfigStore = new ISSOConfigStore(); ssoConfigStore.SetConfigInfo(appName, SSOManager.ConfigIdentifier, appFields); } }