cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass hardcoded user to ConnectionProperties ?

Former Member
0 Kudos
37

Hi,

How can i pass the hardcoded user to the ConnectionProperties constructor for JCA Connections.

ConnectionProperties prop = new ConnectionProperties(request.getLocale(), request.getUser());

i want to pass hardcoded user object in place of - request.getUser()

Thanks,

Raags

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Raags,

you obtain user objects from the user factory object. You have got multiple methods to obtain a user. See javadocs of <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/IUserFactory.html">IUserFactory.</a>

Example:


IUserFactory userFactory = UMFactory.getUserFactory();
IUser myUser = userFactory.getUserByLogonID("MyUser");

Best regards,

Martin

Former Member
0 Kudos

Hi Martin,

I am looking for using a user which is not available in the Portal. If i use getUserByLogonID("sss").. Then user 'sss' should be aavailble in the Portal. But i want to pass user which may or maynot availble on portal but available on the r/3 system i would be calling.

Thanks,

Raags

Answers (1)

Answers (1)

Former Member
0 Kudos

I used the below code to pass a hardcoded/anonymous user to connectionproperties.

IAnonymousUserFactory factory = UMFactory.getAnonymousUserFactory();

IUser user=factory.getAnonymousUser("PORTAL");

Thanks,

Raags