/// <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);
        }
        private static bool Import(string[] args)
        {
            // validate arguments
            string suppressConfirm = string.Empty;
            string fileName        = string.Empty;

            if (args.Length == 2)
            {
                fileName = args[1];
            }
            else if (args.Length == 3)
            {
                suppressConfirm = args[1];
                fileName        = args[2];
            }
            else
            {
                Console.WriteLine("ERROR - Invalid number of arguments.");
                Console.WriteLine();
                return(false);
            }

            // validate suppress confirm
            if (string.IsNullOrEmpty(suppressConfirm) == false && suppressConfirm.ToLower() != "/y")
            {
                Console.WriteLine("ERROR - Invalid option.");
                Console.WriteLine();
                return(false);
            }

            // validate file name
            if (File.Exists(fileName) == false)
            {
                Console.WriteLine("ERROR - The specified SSO application configuration file does not exist.");
                Console.WriteLine();
                return(false);
            }

            // import the SSO application configuration file
            try
            {
                // load the app configuration from the file
                SSOAppConfig appConfig = XmlSerializationUtil.LoadXml <SSOAppConfig>(fileName);
                // check if the application already exists
                if (SSOManager.ApplicationExists(appConfig.AppInfo.Name) == true)
                {
                    bool overrideApp = true;

                    // the application exists, ask the user for confirmation to override
                    // if confirmation was not suppressed
                    if (string.IsNullOrEmpty(suppressConfirm) == true)
                    {
                        Console.WriteLine("SSO application already exists. Override (Y/N)?");
                        int  key = Console.Read();
                        char ch  = Convert.ToChar(key);
                        overrideApp = (ch == 'y' || ch == 'Y');
                    }

                    if (overrideApp == true)
                    {
                        // update/recreate the application
                        SSOManager.UpdateApplication(appConfig, true);
                        Console.WriteLine("SSO application successfully imported.");
                    }
                }
                else
                {
                    // create a new application
                    SSOManager.CreateApplication(appConfig);
                    Console.WriteLine("SSO application successfully imported.");
                }

                return(true);
            }
            catch (Exception ex)
            {
                Console.WriteLine("ERROR - An error has occurred importing the SSO application.");
                Console.WriteLine("");
                Console.WriteLine(ex);
                return(false);
            }
        }