Esempio n. 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: static char[] decode(String param1String, javax.management.ObjectName param1ObjectName) throws Exception
            internal static char[] decode(string param1String, ObjectName param1ObjectName)
            {
                LdapCodeAction ldapCodeAction = new LdapCodeAction(param1String, param1ObjectName);

                try
                {
                    return((char[])AccessController.doPrivileged(ldapCodeAction));
                }
                catch (PrivilegedActionException privilegedActionException)
                {
                    throw privilegedActionException.Exception;
                }
            }
Esempio n. 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public javax.naming.ldap.InitialLdapContext makeLdapInitContext() throws Exception
        public virtual InitialLdapContext makeLdapInitContext()
        {
            this.bindDN         = (string)this.options["bindDN"];
            this.bindCredential = (string)this.options["bindCredential"];
            string str1 = (string)this.options["jaasSecurityDomain"];

            if (!string.ReferenceEquals(str1, null))
            {
                ObjectName objectName  = new ObjectName(str1);
                char[]     arrayOfChar = LdapCodeAction.decode(this.bindCredential, objectName);
                this.bindCredential = new string(arrayOfChar);
            }
            this.baseDN          = (string)this.options["baseCtxDN"];
            this.baseFilter      = (string)this.options["baseFilter"];
            this.roleFilter      = (string)this.options["roleFilter"];
            this.roleAttributeID = (string)this.options["roleAttributeID"];
            if (string.ReferenceEquals(this.roleAttributeID, null))
            {
                this.roleAttributeID = "role";
            }
            string str2 = (string)this.options["roleAttributeIsDN"];

            this.roleAttributeIsDN   = Convert.ToBoolean(str2);
            this.roleNameAttributeID = (string)this.options["roleNameAttributeID"];
            if (string.ReferenceEquals(this.roleNameAttributeID, null))
            {
                this.roleNameAttributeID = "name";
            }
            string str3 = (string)this.options["parseRoleNameFromDN"];

            this.parseRoleNameFromDN = Convert.ToBoolean(str3);
            this.rolesCtxDN          = (string)this.options["rolesCtxDN"];
            string str4 = (string)this.options["roleRecursion"];

            try
            {
                this.recursion = int.Parse(str4);
            }
            catch (Exception)
            {
                this.recursion = 0;
            }
            string str5 = (string)this.options["searchTimeLimit"];

            if (!string.ReferenceEquals(str5, null))
            {
                try
                {
                    this.searchTimeLimit = int.Parse(str5);
                }
                catch (System.FormatException)
                {
                }
            }
            string str6 = (string)this.options["searchScope"];

            if ("OBJECT_SCOPE".Equals(str6, StringComparison.OrdinalIgnoreCase))
            {
                this.searchScope = 0;
            }
            else if ("ONELEVEL_SCOPE".Equals(str6, StringComparison.OrdinalIgnoreCase))
            {
                this.searchScope = 1;
            }
            if ("SUBTREE_SCOPE".Equals(str6, StringComparison.OrdinalIgnoreCase))
            {
                this.searchScope = 2;
            }
            return(constructInitialLdapContext(this.bindDN, this.bindCredential));
        }