예제 #1
0
        private static void ValidateQueryString(string httpURL, ADRawEntry userEntry)
        {
            string text;
            string tenantOrganization = ExchangeRunspaceConfigurationSettings.FromUriConnectionString(httpURL, out text).TenantOrganization;
            string value = tenantOrganization;

            if (string.IsNullOrEmpty(tenantOrganization))
            {
                return;
            }
            AuthZLogger.SafeSetLogger(ConfigurationCoreMetadata.ManagedOrganization, value);
            OrganizationId organizationId = userEntry[ADObjectSchema.OrganizationId] as OrganizationId;

            if (organizationId != null && !ExchangeRunspaceConfiguration.IsAllowedOrganizationForPartnerAccounts(organizationId))
            {
                AuthZLogger.SafeAppendGenericError("ValidateQueryString", string.Format("Organization {0} not allowed for partner account.", organizationId.ToString()), false);
                ExTraceGlobals.AccessDeniedTracer.TraceError <ADObjectId>(0L, "EAP.ValidateQueryString returns AccessDenied because user {0} does not belong to the appropriate organization", userEntry.Id);
                throw new NotAllowedForPartnerAccessException(Strings.ErrorNotAllowedForPartnerAccess);
            }
            Uri uri;

            if (!Uri.TryCreate(httpURL, UriKind.Absolute, out uri))
            {
                AuthZLogger.SafeAppendGenericError("ValidateQueryString", string.Format("Url {0} Incorrect.", httpURL), false);
                ExTraceGlobals.AccessDeniedTracer.TraceError <ADObjectId, string, string>(0L, "EAP.ValidateQueryString returns AccessDenied because tenant user {0} requested partner access to {1} which is not found in the local forest and URL {2} is invalid", userEntry.Id, tenantOrganization, httpURL);
                throw new UrlInValidException(Strings.ErrorUrlInValid);
            }
            ExTraceGlobals.ADConfigTracer.TraceDebug(0L, "EAP.ValidateQueryString returns Success.");
        }
예제 #2
0
        protected virtual ExchangeRunspaceConfigurationSettings BuildRunspaceConfigurationSettings(string connectionString, IIdentity identity)
        {
            string text;
            ExchangeRunspaceConfigurationSettings exchangeRunspaceConfigurationSettings = ExchangeRunspaceConfigurationSettings.FromUriConnectionString(connectionString, ExchangeRunspaceConfigurationSettings.ExchangeApplication.PowerShell, out text);

            exchangeRunspaceConfigurationSettings.LanguageMode = AppSettings.Current.PSLanguageMode;
            return(exchangeRunspaceConfigurationSettings);
        }
 // Token: 0x060013EF RID: 5103 RVA: 0x0004630D File Offset: 0x0004450D
 internal static ExchangeRunspaceConfigurationSettings FromUriConnectionString(string connectionString, out string vdirPath)
 {
     return(ExchangeRunspaceConfigurationSettings.FromUriConnectionString(connectionString, ExchangeRunspaceConfigurationSettings.ExchangeApplication.Unknown, out vdirPath));
 }