cancel
Showing results for 
Search instead for 
Did you mean: 

Creating service user

0 Kudos

Could someone help me?

I am trying to create service user for reading the PCD content from Portal service

I am using this piece of code:

private IUser getServiceUser(String strUser ) {

final String strServiceUser = strUser;

IUser serviceUser = null;

try {

serviceUser =(IUser) AccessController.doPrivileged(

new PrivilegedExceptionAction()

{

public Object run() throws NamingException

{

IUserManagementEngine umService = (IUserManagementEngine) PortalRuntime.getRuntimeResources().getService( IUserManagementEngine.KEY );

IServiceUserFactory userFactory = umService.getServiceUserFactory();

IUser user = null;

try {

userFactory.createServiceUser(strServiceUser);

user = userFactory.getServiceUser(strServiceUser);

} catch (UMException e) {

myLoc.traceThrowableT(Severity.ERROR, "", e);

}

return user;

}

}

);

} catch (PrivilegedActionException ex) {

}

return serviceUser;

}

For accesing IUserManagementEngine I put in portalapp.xml

new entry in SharingReference: com.sap.portal.usermanagment

But in runtime I receive exception :

Caused by: com.sapportals.portal.prt.core.broker.PortalApplicationNotFoundException: Could not find portal application com.sap.portal.usermanagment

I check in portal (System Administrator -> Support -> PortalRuntime -> Application Console ) that com.sap.portal.usermanagment application is deployed on my engine

Why my portal service couldn't found com.sap.portal.usermanagment application ??

Accepted Solutions (1)

Accepted Solutions (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Rosen,

> com.sap.portal.usermanagment

If you also typed this within portalapp.xml, try

com.sap.portal.usermanag<u>e</u>ment

Hope it helps

Detlev

0 Kudos

Hi Detlev

Thank you very much

0 Kudos

Creating a new user still have a problem (Access denied)

Strange for me but:

When I invoke

IUser principalObj = getServiceUser("pcd_service");

This is the default pcd user - no problem

but when I try to create my new "service user"

for example :

IUser principalObj = getServiceUser("pcd_test_rosen_service_user");

I have access denied - when try to reading the PCD content

#1.5#000A5E3C51C00040000002AF00000BB40003FC804AB8D460#1122052869781#com.sap.security#

sap.com/irj#com.sap.security.logToFile#

Administrator#1449#####

SAPEngine_Application_Thread[impl:3]_15##0#0#Error#1#/System/Security/Audit#Plain###Administrator | USERACCOUNT.CREATE | USERACCOUNT = UACC.PRIVATE_DATASOURCE.un:pcd_test_rosen_service | | SET_ATTRIBUTE: userid=[USER.PRIVATE_DATASOURCE.un:pcd_test_rosen_service]#

#1.5#000A5E3C51C00040000002B000000BB40003FC804AB9B80D#1122052869797#com.sap.tc.lm.ctc.cpa.pcd.PCDProviderReader#sap.com/irj#com.sap.tc.lm.ctc.cpa.pcd.PCDProviderReader#Administrator#1449#####SAPEngine_Application_Thread[impl:3]_15##0#0#Error##Java###

#1#com.sapportals.portal.pcd.gl.PermissionControlException: Access denied (Object: portal_content)

at com.sapportals.portal.pcd.gl.PcdFilterContext.filterLookup(PcdFilterContext.java:415)

May be I have to add something in my method getServiceUser()

But what ??

Could someone help me ?

Please provide me a very simple working example - that create new "service user" for PCD access

Implementation of my method getServiceUser is in my first message (in this topic)

Message was edited by: Rosen Chaushev

Message was edited by: Rosen Chaushev

Answers (1)

Answers (1)

Former Member
0 Kudos