ldap add attribute and value

Discussion in 'Java' started by RigasMinho, Mar 23, 2007.

  1. RigasMinho

    RigasMinho Guest

    Hi,
    Is there a way to add an ldap attritbute to an entry and then definate
    a certail value to the entry.

    For example I have a user id - with John Smith
    When i look at the entry it says
    "DOB" - 00-00-00
    "Password" - 12345

    How do I make it so that when my java code runs it adds a new
    attritbute like "ssn" and puts in a value for work as wel?

    So afterwards you see -
    "DOB" - 00-00-00
    "Password" - 12345
    "Social Security" - 12345


    I have this but it doesnt work
    int SSN=12345
    ldapAttr1 = new LDAPAttribute("Social Security",SSN);
     
    RigasMinho, Mar 23, 2007
    #1
    1. Advertising

  2. RigasMinho

    NeoGeoSNK Guest

    On Mar 24, 3:32 am, "RigasMinho" <> wrote:
    > Hi,
    > Is there a way to add an ldap attritbute to an entry and then definate
    > a certail value to the entry.
    >
    > For example I have a user id - with John Smith
    > When i look at the entry it says
    > "DOB" - 00-00-00
    > "Password" - 12345
    >
    > How do I make it so that when my java code runs it adds a new
    > attritbute like "ssn" and puts in a value for work as wel?
    >
    > So afterwards you see -
    > "DOB" - 00-00-00
    > "Password" - 12345
    > "Social Security" - 12345
    >
    > I have this but it doesnt work
    > int SSN=12345
    > ldapAttr1 = new LDAPAttribute("Social Security",SSN);


    May be you must first add the new attribute in the Objectclass, and
    then load the objectclass of this entry.
    NY
     
    NeoGeoSNK, Mar 24, 2007
    #2
    1. Advertising

  3. RigasMinho

    Nigel Wade Guest

    RigasMinho wrote:

    > Hi,
    > Is there a way to add an ldap attritbute to an entry and then definate
    > a certail value to the entry.
    >
    > For example I have a user id - with John Smith
    > When i look at the entry it says
    > "DOB" - 00-00-00
    > "Password" - 12345
    >
    > How do I make it so that when my java code runs it adds a new
    > attritbute like "ssn" and puts in a value for work as wel?
    >
    > So afterwards you see -
    > "DOB" - 00-00-00
    > "Password" - 12345
    > "Social Security" - 12345
    >
    >
    > I have this but it doesnt work
    > int SSN=12345
    > ldapAttr1 = new LDAPAttribute("Social Security",SSN);


    Any attribute you use in an LDAP directory must have a definition in the schema
    as an attributetype. This defines the meaning of the attribute and the types of
    data it holds. The schema for an objectclass defines what attributes can be
    contained within the object. You can't just add any piece of text as an
    attribute.

    What is the schema for your user id, and does it include any attribute for
    "Social Security"?

    --
    Nigel Wade, System Administrator, Space Plasma Physics Group,
    University of Leicester, Leicester, LE1 7RH, UK
    E-mail :
    Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
     
    Nigel Wade, Mar 26, 2007
    #3
  4. RigasMinho

    RigasMinho Guest

    On Mar 26, 11:58 am, Nigel Wade <> wrote:
    > RigasMinho wrote:
    > > Hi,
    > > Is there a way to add an ldap attritbute to an entry and then definate
    > > a certail value to the entry.

    >
    > > For example I have a user id - with John Smith
    > > When i look at the entry it says
    > > "DOB" - 00-00-00
    > > "Password" - 12345

    >
    > > How do I make it so that when my java code runs it adds a new
    > > attritbute like "ssn" and puts in a value for work as wel?

    >
    > > So afterwards you see -
    > > "DOB" - 00-00-00
    > > "Password" - 12345
    > > "Social Security" - 12345

    >
    > > I have this but it doesnt work
    > > int SSN=12345
    > > ldapAttr1 = new LDAPAttribute("Social Security",SSN);

    >
    > Any attribute you use in an LDAP directory must have a definition in the schema
    > as an attributetype. This defines the meaning of the attribute and the types of
    > data it holds. The schema for an objectclass defines what attributes can be
    > contained within the object. You can't just add any piece of text as an
    > attribute.
    >
    > What is the schema for your user id, and does it include any attribute for
    > "Social Security"?
    >
    > --
    > Nigel Wade, System Administrator, Space Plasma Physics Group,
    > University of Leicester, Leicester, LE1 7RH, UK
    > E-mail :
    > Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555- Hide quoted text -
    >
    > - Show quoted text -


    Yeah i resolved it - i just created another ldap attribute and used
    the replace function.
     
    RigasMinho, Mar 29, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    536
    Raymond DeCampo
    Feb 21, 2006
  2. Replies:
    1
    Views:
    4,305
    Joe Kesselman
    Aug 2, 2006
  3. Replies:
    8
    Views:
    523
  4. rcmn
    Replies:
    1
    Views:
    343
    =?ISO-8859-1?Q?Michael_Str=F6der?=
    Nov 6, 2006
  5. dkmd_nielsen
    Replies:
    6
    Views:
    228
    Joel VanderWerf
    Nov 26, 2008
Loading...

Share This Page