Esempio n. 1
0
        public Schema GetSchema(KeyedCollection <string, ConfigParameter> configParameters)
        {
            Microsoft.MetadirectoryServices.SchemaType personType = Microsoft.MetadirectoryServices.SchemaType.Create("Person", false);

            this.GetMAConfig(configParameters);


            string[] rsaAttributes = new string[10];
            rsaAttributes[0] = "First Name";
            rsaAttributes[1] = "Last Name";
            rsaAttributes[2] = "Middle Name";
            rsaAttributes[3] = "User ID";
            rsaAttributes[4] = "Manager Email Address";
            rsaAttributes[5] = "Identity Source";
            rsaAttributes[6] = "Security Domain";
            rsaAttributes[7] = "Lockout Status";
            rsaAttributes[8] = "Token Serial Number";
            rsaAttributes[9] = "Token GUID";


            foreach (string attribName in rsaAttributes)
            {
                if (attribName == "User ID")
                {
                    personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(attribName, AttributeType.String));
                }

                else if (attribName == "Token Serial Number" || attribName == "Token GUID")
                {
                    personType.Attributes.Add(SchemaAttribute.CreateMultiValuedAttribute(attribName, AttributeType.String));
                }

                else
                {
                    personType.Attributes.Add(SchemaAttribute.CreateSingleValuedAttribute(attribName, AttributeType.String));
                }
            }

            Schema schema = Schema.Create();

            schema.Types.Add(personType);

            return(schema);
        }
        public Schema GetSchema(KeyedCollection <string, ConfigParameter> configParameters)
        {
            Microsoft.MetadirectoryServices.SchemaType personType = Microsoft.MetadirectoryServices.SchemaType.Create("Person", false);

            //myname = configParameters["myname"].Value;

            string myattribute1 = "USERNAME";
            string myattribute2 = "PASSWORD";
            string myattribute3 = "EMPLOYEE_ID";
            string myattribute4 = "FIRST_NAME";
            string myattribute5 = "LAST_NAME";
            string myattribute6 = "EMAIL";
            string myattribute7 = "EMPLOYEE_STATUS";
            string myattribute8 = "ROLE_ASSIGNMENT";
            string myattribute9 = "WORKPHONE";

            if (myattribute1 == "USERNAME")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute1, AttributeType.String));
            }

            if (myattribute2 == "PASSWORD")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute2, AttributeType.String));
            }

            if (myattribute3 == "EMPLOYEE_ID")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute3, AttributeType.String));
            }

            if (myattribute4 == "FIRST_NAME")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute4, AttributeType.String));
            }

            if (myattribute5 == "LAST_NAME")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute5, AttributeType.String));
            }

            if (myattribute6 == "EMAIL")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute6, AttributeType.String));
            }

            if (myattribute7 == "EMPLOYEE_STATUS")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute7, AttributeType.String));
            }

            if (myattribute8 == "ROLE_ASSIGNMENT")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute8, AttributeType.String));
            }

            if (myattribute9 == "WORKPHONE")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute9, AttributeType.String));
            }

            Schema schema = Schema.Create();

            schema.Types.Add(personType);

            return(schema);
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="importRunStep"></param>
        /// <returns></returns>

        public Schema GetSchema(KeyedCollection <string, ConfigParameter> configParameters)
        {
            Microsoft.MetadirectoryServices.SchemaType personType = Microsoft.MetadirectoryServices.SchemaType.Create("Person", false);

            //myname = configParameters["myname"].Value;

            string myattribute1  = "title";
            string myattribute2  = "username";
            string myattribute3  = "email";
            string myattribute4  = "firstName";
            string myattribute5  = "lastName";
            string myattribute6  = "mobileNo";
            string myattribute7  = "verifiedMobileNo";
            string myattribute8  = "passportId";
            string myattribute9  = "emailVerified";
            string myattribute10 = "mobileNoVerified";
            string myattribute11 = "userStore";
            string myattribute12 = "password";
            string myattribute13 = "confirmPassword";
            string myattribute14 = "oldPassword";

            if (myattribute1 == "title")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute1, AttributeType.String));
            }

            if (myattribute2 == "username")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute2, AttributeType.String));
            }

            if (myattribute3 == "email")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute3, AttributeType.String));
            }

            if (myattribute4 == "firstName")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute4, AttributeType.String));
            }

            if (myattribute5 == "lastName")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute5, AttributeType.String));
            }

            if (myattribute6 == "mobileNo")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute6, AttributeType.String));
            }

            if (myattribute7 == "verifiedMobileNo")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute7, AttributeType.String));
            }

            if (myattribute8 == "passportId")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute8, AttributeType.String));
            }

            if (myattribute9 == "emailVerified")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute9, AttributeType.String));
            }

            if (myattribute10 == "mobileNoVerified")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute10, AttributeType.String));
            }

            if (myattribute11 == "userStore")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute11, AttributeType.String));
            }

            if (myattribute12 == "password")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute12, AttributeType.String));
            }

            if (myattribute13 == "confirmPassword")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute13, AttributeType.String));
            }

            if (myattribute14 == "oldPassword")
            {
                personType.Attributes.Add(SchemaAttribute.CreateAnchorAttribute(myattribute14, AttributeType.String));
            }

            Schema schema = Schema.Create();

            schema.Types.Add(personType);

            return(schema);
        }