Expand my Community achievements bar.

Get user info from Canonical name

Avatar

Level 2

I'm implementing a client for rights management.

I need to have a page that displays info about the policies.

I get the policies from RightsManagementClient / PolicyManager.getPolicies

in these policies is a list of policy entry who tells which user/group can access this policy. In these policy entries is a principal object who has a canonical name (there is also the domain name evntually). Most of the other data are empty.

So I need to get user data from this principal/canonical name.

I have tried DirectoryManagerServiceClient.findUsers. In the docu it s said that it takes a filter in which I can set the canonical name

1) eclispe tells me it s deprecated (the docu doesn't)

2) whatever I try, I get this exception:

errorCode:16385 errorCodeHEX:0x4001 message:Exception wrapped in DSCException is Null or NOT An Instance of UMException chainedException:ALC-DSC-213-000: com.adobe.idp.dsc.DSCException: No Credential or Context setchainedExceptionMessage:No Credential or Context set chainedException trace:ALC-DSC-213-000: com.adobe.idp.dsc.DSCException: No Credential or Context set
    at com.adobe.idp.dsc.interceptor.impl.AuthorizationInterceptor.intercept(AuthorizationInterceptor.java:114)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)
    at com.adobe.idp.dsc.interceptor.impl.JMXInterceptor.intercept(JMXInterceptor.java:48)
    at com.adobe.idp.dsc.interceptor.impl.RequestInterceptorChainImpl.proceed(RequestInterceptorChainImpl.java:60)
    at com.adobe.idp.dsc.engine.impl.ServiceEngineImpl.invoke(ServiceEngineImpl.java:115)
    at com.adobe.idp.dsc.routing.Router.routeRequest(Router.java:118)
    at com.adobe.idp.dsc.provider.impl.base.AbstractMessageReceiver.invoke(AbstractMessageReceiver.java:315)
    at com.adobe.idp.dsc.provider.impl.ejb.receiver.EjbReceiverBean.invoke(EjbReceiverBean.java:156)

...

What do I do wrong? is there something else to set in this filter when we want to do it with the canonical name?

Is there another way because I didn't find any myself??

Thanks for your help

Antoine

1 Reply

Avatar

Level 2

You need to use the getPrincipals function. If you want to focus on users you can also set the search filter "setPrincipalType" to "USERS"