[ 
https://issues.apache.org/jira/browse/DIRKRB-293?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14593223#comment-14593223
 ] 

Xu Yaning commented on DIRKRB-293:
----------------------------------

Hi Kiran, I try to modify an entry, which contains an operational attribute 
{{createTimestamp}}. It runs without exception. However, when I try to get the 
entry, it turns out the modification doesn't work. The code is as follows.
{code}
    protected KrbIdentity doAddIdentity(KrbIdentity identity) {
        String principalName = identity.getPrincipalName();
        String[] names = principalName.split("@");
        String uid = names[0];
        Entry entry = new DefaultEntry();
        KeysInfo keysInfo = new KeysInfo(identity);
        try {
            Dn dn = new Dn(new Rdn("uid", uid), new Dn(BASE_DN));
            entry.setDn(dn);
            entry.add("objectClass", "top", "person", "inetOrgPerson", 
"krb5principal", "krb5kdcentry");
            entry.add("cn", names[0]);
            entry.add( "sn", names[0]);
            entry.add(KerberosAttribute.KRB5_KEY_AT, keysInfo.getKeys());
            entry.add( "krb5EncryptionType", keysInfo.getEtypes());
            entry.add( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, principalName);
            entry.add( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT, 
identity.getKeyVersion() + "");
            entry.add( "krb5KDCFlags", "" + identity.getKdcFlags());
            entry.add( KerberosAttribute.KRB5_ACCOUNT_DISABLED_AT, "" + 
identity.isDisabled());
            entry.add( "createTimestamp",
                    toGeneralizedTime(identity.getCreatedTime()));
            entry.add(KerberosAttribute.KRB5_ACCOUNT_LOCKEDOUT_AT, "" + 
identity.isLocked());
            entry.add( KerberosAttribute.KRB5_ACCOUNT_EXPIRATION_TIME_AT,
                    toGeneralizedTime(identity.getExpireTime()));
            connection.add(entry);
        } catch (LdapInvalidDnException e) {
            e.printStackTrace();
        } catch (LdapException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return identity;
    }
{code}

Thanks!

> Implementing doUpdateIdentity for LdapIdentityBackend
> -----------------------------------------------------
>
>                 Key: DIRKRB-293
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-293
>             Project: Directory Kerberos
>          Issue Type: Sub-task
>            Reporter: Xu Yaning
>            Assignee: Xu Yaning
>         Attachments: DIRKRB-293-v1.patch, DIRKRB-293-v2.patch
>
>
> Impelment {{doUpdateIdentity}} for {{LdapIdentityBackend}} to update an 
> identity.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to