By: Justin Chen user 08 Jun 2018 at 4:23 p.m. CDT

2 Responses
Justin Chen gravatar
So basically, in short I added custom attributes to the 77-customAttributes folder as follows: ``` dn: cn=schema objectClass: top objectClass: ldapSubentry objectClass: subschema cn: schema objectClasses: ( 1.3.6.1.4.1.48710.1.4.101 NAME 'gluuCustomPerson' SUP ( top ) AUXILIARY MAY ( telephoneNumber $ mobile $ carLicense $ facsimileTelephoneNumber $ departmentNumber $ employeeType $ cn $ st $ manager $ street $ postOfficeBox $ employeeNumber $ preferredDeliveryMethod $ roomNumber $ secretary $ homePostalAddress $ l $ postalCode $ description $ title $ userid $ emailid $ firstname $ lastname $ institute $ groups ) X-ORIGIN 'Gluu - Custom persom objectclass' ) attributeTypes: ( 1.3.6.1.4.1.48710.1.3.1000 NAME 'userid' DESC 'Custom Attribute UserID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu custom attribute' ) attributeTypes: ( 1.3.6.1.4.1.48710.1.3.1001 NAME 'emailid' DESC 'Custom Attribute UserID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu custom attribute' ) attributeTypes: ( 1.3.6.1.4.1.48710.1.3.1002 NAME 'firstname' DESC 'Custom Attribute UserID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu custom attribute' ) attributeTypes: ( 1.3.6.1.4.1.48710.1.3.1003 NAME 'lastname' DESC 'Custom Attribute UserID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu custom attribute' ) attributeTypes: ( 1.3.6.1.4.1.48710.1.3.1004 NAME 'institute' DESC 'Custom Attribute UserID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu custom attribute' ) attributeTypes: ( 1.3.6.1.4.1.48710.1.3.1005 NAME 'groups' DESC 'Custom Attribute UserID' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Gluu custom attribute' ) ``` I tried to register this and it said "Cannot add "emailid" because the attribute does not belong to a list of allowed object classes." I ended up also adding these attributes to the custom.schema file under gluuCustomperson. It wasn't until I added them to the 101ox file under gluuPerson object that I could register them. So two questions: 1. Why aren't mapping right from the 77-customattributes file, and 2. If I put them all under gluuPerson in the 101ox file, do I also need to move the attributes themselves to that file, or can they be mapped from the 77-customattributes file? Thanks! Justin

By Aliaksandr Samuseu staff 08 Jun 2018 at 5:48 p.m. CDT

Aliaksandr Samuseu gravatar
Hi, Justin. >I tried to register this and it said "Cannot add "emailid" because the attribute does not belong to a list of allowed object classes." I ended up also adding these attributes to the custom.schema file under gluuCustomperson. It wasn't until I added them to the 101ox file under gluuPerson object that I could register them. According [to the docs](https://gluu.org/docs/ce/3.1.3/admin-guide/attribute/#opendj), you must add your attributes to `77-customAttributes.ldif` file, and then also **must** add them to `gluuCustomPerson` OC in that very file, and restart OpenDJ's service. No more schema editing should be needed. We strongly discourage editing of other schema files there, unless you know perfectly what are you doing. You should revert all your changes to core schema files, and try to follow steps provided in docs again, you could do something wrong first time.

By Justin Chen user 08 Jun 2018 at 8:32 p.m. CDT

Justin Chen gravatar
Hello! Yes that is exactly what I did the first time. As you can see in the code posted above, I added the following under the gluuCustomPerson: ``` $ userid $ emailid $ firstname $ lastname $ institute $ groups ``` That's why I was so confused why gluu wouldn't let me register them. It's as if opendj and gluu don't see the gluuCustomPerson in the 77-customAttributes.ldif file.