This discussion is archived
7 Replies Latest reply: Jun 30, 2013 7:52 PM by Srinath Menon RSS

How to manipulate Credential maps programmatically?

user784874 Newbie
Currently Being Moderated
Hi,

I am doing a POC to pull groups from OID and Map groups to UCM roles using credential Mapping. I have found ways to create roles and assign privileges. I would like to know programmatic way of Adding/Modifying/removing groups and roles on credential map.

Is there any way to manipulate using Java api like RIDC/JCR?

Thanks,
Suresh K
  • 1. Re: How to manipulate Credential maps programmatically?
    Srinath Menon Guru
    Currently Being Moderated
    Hi Suresh ,

    This is the code snippet used to add / edit credential maps in UCM server using RIDC :

    DataBinder dataBinder = idcClient.createBinder();
    dataBinder.putLocal("IdcService", "ADD_EDIT_CREDENTIALS_MAP");
    dataBinder.putLocal ("mapId","RIDCTest");
    dataBinder.putLocal("mapNames" ,"RIDCTest");
    dataBinder.putLocal("mapValue","abc,admin\n xyz,sysmanager\n |#all|,%%\n \\@|#all|,\\@%%\n test,admin\n new,test\n deployer,contributor\n");


    \n is the separator to instruct ucm that the next line is a new attribute / map being added .

    \\ - double slash is used to set \@ which is special character .

    So my map would be set on ucm like this :

    abc, admin
    xyz, sysmanager
    |#all|, %%
    \@|#all|, \@%%
    test, admin
    new, test
    deployer, contributor


    Hope this helps .

    Thanks,
    Srinath
  • 2. Re: How to manipulate Credential maps programmatically?
    user784874 Newbie
    Currently Being Moderated

    Hi,

     

    Is there any limitation on number of entries on crdentail map?

     

    Thanks,

    Suresh K

  • 3. Re: How to manipulate Credential maps programmatically?
    Srinath Menon Guru
    Currently Being Moderated

    Hi ,

    I don't think there is any limitation as such for that .

     

    It depends on how many maps can be administered by ucm admin .

     

    Thanks,

    Srinath

  • 4. Re: How to manipulate Credential maps programmatically?
    user784874 Newbie
    Currently Being Moderated

    Hi Srinath,

     

    Thanks for your response.

     

    I am interested in modifying only few entries in credential map.in order to achieve this should i get entire credential map value as string,do the string parsing and update the values and map the entire value again on the credential map? or Can we update only interested entries directly?

     

    Let us consider below example i just want to remove second line pro-grammatically from 'RIDCTest' without mapping entire values once again. is this possible?

    abc, admin

    xyz, sysmanager

    |#all|, %%

    \@|#all|, \@%%

    deployer, contributor

     

     

    Can you please share Service reference guide or anything which will have more details about editing credential map using RIDC?

     

     

    Thanks,

    Suresh K

  • 5. Re: How to manipulate Credential maps programmatically?
    Srinath Menon Guru
    Currently Being Moderated

    Hi Suresh ,

     

    Yeah, even if it means to edit a single line you will have to send all the existing maps along with modified data . That is how the service is taking these parameters . Service reference guide does not have details on this service call, I used server output tracing and Fiddler to get these details .

     

    Thanks,

    Srinath

  • 6. Re: How to manipulate Credential maps programmatically?
    user784874 Newbie
    Currently Being Moderated

    Hi Srinath,

     

    Thanks for your response

     

    I am curious about synchronization. sendRequest will be used to send DataBinder object to server. Can you please confirm sendRequest method is synchronized or not? if it is not synchronized then i need to take care of synchronization to prevent modifying credential map simultaneously by multiple threads.

     

    Thanks,

    Suresh K

  • 7. Re: How to manipulate Credential maps programmatically?
    Srinath Menon Guru
    Currently Being Moderated

    Hi Suresh ,

     

    You will need to test this by running the same ridc code as 2 users around the same time and seeing the results for it . I believe the last request would definitely overwrite the previous one .

     

    Not much sure about the synchronization part .

     

    Thanks,

    Srinath