Esempio n. 1
0
        internal static void SetAuthenticationMethodHelper(bool value, IPropertyBag propertyBag, AuthenticationMethod method)
        {
            bool flag  = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.Basic);
            bool flag2 = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.Digest);
            bool flag3 = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.WindowsIntegrated);
            bool flag4 = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.Fba);
            bool flag5 = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.LiveIdFba);
            bool flag6 = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.Adfs);
            bool flag7 = ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.OAuth);

            switch (method)
            {
            case AuthenticationMethod.Basic:
                flag = value;
                if (!flag)
                {
                    flag4 = false;
                }
                else
                {
                    flag5 = false;
                }
                break;

            case AuthenticationMethod.Digest:
                flag2 = value;
                if (flag2)
                {
                    flag4 = false;
                    flag5 = false;
                }
                break;

            case AuthenticationMethod.Fba:
                flag4 = value;
                if (!flag4)
                {
                    flag = false;
                }
                else
                {
                    flag  = true;
                    flag2 = false;
                    flag3 = false;
                    flag5 = false;
                }
                break;

            case AuthenticationMethod.WindowsIntegrated:
                flag3 = value;
                if (flag3)
                {
                    flag4 = false;
                    flag5 = false;
                }
                break;

            case AuthenticationMethod.LiveIdFba:
                flag5 = value;
                if (flag5)
                {
                    flag  = false;
                    flag2 = false;
                    flag3 = false;
                    flag4 = false;
                    flag6 = false;
                }
                break;

            case AuthenticationMethod.OAuth:
                flag7 = value;
                break;

            case AuthenticationMethod.Adfs:
                flag6 = value;
                if (flag6)
                {
                    flag5 = false;
                }
                break;
            }
            propertyBag[ExchangeWebAppVirtualDirectorySchema.WindowsAuthentication] = flag3;
            propertyBag[ExchangeWebAppVirtualDirectorySchema.BasicAuthentication]   = flag;
            propertyBag[ExchangeWebAppVirtualDirectorySchema.DigestAuthentication]  = flag2;
            propertyBag[ExchangeWebAppVirtualDirectorySchema.FormsAuthentication]   = flag4;
            ArrayList arrayList = new ArrayList();

            if (flag)
            {
                arrayList.Add(AuthenticationMethod.Basic);
            }
            if (flag2)
            {
                arrayList.Add(AuthenticationMethod.Digest);
            }
            if (flag3)
            {
                arrayList.Add(AuthenticationMethod.WindowsIntegrated);
                arrayList.Add(AuthenticationMethod.Ntlm);
            }
            if (flag4)
            {
                arrayList.Add(AuthenticationMethod.Fba);
            }
            if (flag5)
            {
                arrayList.Add(AuthenticationMethod.LiveIdFba);
            }
            if (flag6)
            {
                arrayList.Add(AuthenticationMethod.Adfs);
            }
            if (flag7)
            {
                arrayList.Add(AuthenticationMethod.OAuth);
            }
            MultiValuedProperty <AuthenticationMethod> value2 = new MultiValuedProperty <AuthenticationMethod>(arrayList);

            propertyBag[ADVirtualDirectorySchema.InternalAuthenticationMethods] = value2;
        }
Esempio n. 2
0
 internal static object OAuthAuthenticationGetter(IPropertyBag propertyBag)
 {
     return(ExchangeWebAppVirtualDirectory.GetAuthenticationMethodHelper(propertyBag, AuthenticationMethod.OAuth));
 }