private static string ReadTenanteId()
        {
            string appSetting = AadConfig.GetAppSetting(N.TenantId, null);

            if (appSetting == null)
            {
                throw new Exception(string.Format("AppSettings missing the entry '{0}'. Exmple: mydomain.com or mydomain.onmicrosoft.com", N.TenantId));
            }
            return(appSetting);
        }
        private static string ReadClientId()
        {
            string appSetting = AadConfig.GetAppSetting(N.ClientId, null);

            if (appSetting == null)
            {
                appSetting = AadConfig.GetAppSetting(N.ApplicationId, null);
                if (appSetting == null)
                {
                    throw new Exception(string.Concat(string.Format("AppSettings missing the entry '{0}'.", N.ApplicationId), Environment.NewLine, "Use 'Application ID' which is a Guid or 'App ID URI' available under Settings -> Properties."));
                }
            }
            return(appSetting);
        }