// Token: 0x0600000B RID: 11 RVA: 0x0000220C File Offset: 0x0000040C
        private static CommonAccessToken CommonAccessTokenFromUrl(string user, Uri requestURI, out Exception ex)
        {
            if (requestURI == null)
            {
                throw new ArgumentNullException("requestURI");
            }
            ex = null;
            CommonAccessToken   result = null;
            NameValueCollection nameValueCollectionFromUri = LiveIdBasicAuthModule.GetNameValueCollectionFromUri(requestURI);
            string text = nameValueCollectionFromUri.Get("X-Rps-CAT");

            if (!string.IsNullOrWhiteSpace(text))
            {
                try
                {
                    result = CommonAccessToken.Deserialize(Uri.UnescapeDataString(text));
                }
                catch (Exception ex2)
                {
                    Logger.TraceError(ExTraceGlobals.RemotePowershellBackendCmdletProxyModuleTracer, "Got exception when trying to parse CommonAccessToken: {0}.", new object[]
                    {
                        ex2.ToString()
                    });
                    Logger.LogEvent(TaskEventLogConstants.Tuple_LogInvalidCommonAccessTokenReceived, text, new object[]
                    {
                        user,
                        requestURI.ToString(),
                        Strings.ErrorWhenParsingCommonAccessToken(ex2.ToString())
                    });
                    ex = ex2;
                }
            }
            return(result);
        }
        // Token: 0x060013F0 RID: 5104 RVA: 0x00046318 File Offset: 0x00044518
        internal static ExchangeRunspaceConfigurationSettings FromUriConnectionString(string connectionString, ExchangeRunspaceConfigurationSettings.ExchangeApplication defaultApplication, out string vdirPath)
        {
            Uri uri = new Uri(connectionString, UriKind.Absolute);

            vdirPath = ExchangeRunspaceConfigurationSettings.GetVDirPathFromUriLocalPath(uri);
            if (string.IsNullOrEmpty(uri.Query))
            {
                return(ExchangeRunspaceConfigurationSettings.GetDefaultInstance());
            }
            NameValueCollection nameValueCollectionFromUri = LiveIdBasicAuthModule.GetNameValueCollectionFromUri(uri);

            return(ExchangeRunspaceConfigurationSettings.CreateConfigurationSettingsFromNameValueCollection(uri, nameValueCollectionFromUri, defaultApplication));
        }
Пример #3
0
        private string ExpandVersions(string connectionString)
        {
            Uri uri = new Uri(connectionString, UriKind.Absolute);
            NameValueCollection nameValueCollectionFromUri = LiveIdBasicAuthModule.GetNameValueCollectionFromUri(uri);
            string        text                 = nameValueCollectionFromUri.Get("ExchClientVer");
            string        text2                = nameValueCollectionFromUri.Get("ClientApplication");
            StringBuilder stringBuilder        = new StringBuilder();
            string        supportedEMCVersions = AppSettings.Current.SupportedEMCVersions;

            if (supportedEMCVersions.Contains("*"))
            {
                if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2) && text2.Equals("EMC", StringComparison.OrdinalIgnoreCase))
                {
                    try
                    {
                        ExchangeBuild exchangeBuild = ExchangeBuild.Parse(text);
                        string[]      array         = supportedEMCVersions.Split(new char[]
                        {
                            ';'
                        });
                        foreach (string text3 in array)
                        {
                            if (!string.IsNullOrEmpty(text3))
                            {
                                if (text3.Contains("*"))
                                {
                                    string[] array3 = text3.Split(new char[]
                                    {
                                        '.'
                                    });
                                    int num;
                                    int num2;
                                    if (array3.Length == 4 && int.TryParse(array3[0], out num) && num == (int)exchangeBuild.Major && (string.Equals(array3[1], "*") || (int.TryParse(array3[1], out num2) && num2 == (int)exchangeBuild.Minor && string.Equals(array3[2], "*"))))
                                    {
                                        for (int j = 1; j < 999; j++)
                                        {
                                            stringBuilder.Append(string.Format(";{0}.{1}.{2}.0", exchangeBuild.Major, exchangeBuild.Minor, j));
                                        }
                                        break;
                                    }
                                }
                                else
                                {
                                    stringBuilder.Append(string.Format(";{0}", text3));
                                }
                            }
                        }
                        goto IL_1D3;
                    }
                    catch (ArgumentException)
                    {
                        stringBuilder.Append(SupportedVersionList.DefaultVersionString);
                        goto IL_1D3;
                    }
                }
                stringBuilder.Append(SupportedVersionList.DefaultVersionString);
            }
            else
            {
                stringBuilder.Append(supportedEMCVersions);
            }
IL_1D3:
            return(stringBuilder.ToString());
        }