cancel
Showing results for 
Search instead for 
Did you mean: 

Hard code username-password to connect to back-end

Former Member
0 Kudos

Hi

I'm using this piece of code to connect to the back-end via a defined system (system alias = CN)

IConnectorGatewayService cgservice =(IConnectorGatewayService) PortalRuntime								.getRuntimeResources()						                .getService(IConnectorService.KEY);
		
ConnectionProperties cp = new ConnectionProperties(request.getLocale(), request.getUser());

try {
	con = cgservice.getConnection("CN", cp);
	}
	catch (Exception e)
 {
			   e.printStackTrace();
  }

Is there a way I can pass hard-coded username/password in "ConnectionProperties(__,__)" instead of retrieving the logged-on user? i don't want to do user-mapping on the portal for connecting to the backend.

Thanks,

Prerana

Points will be awarded generously for helpful answers

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

ConnectionProperties constructor does not allow you to give the locale and user hardcoded. But instead of populating the local and user from request, you can create them with the hardcoded values by the respective locale and user APIs.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Prerana,

did you find a solution for this?

I've the same requirement and I'm still searching for a solution.

Thanks a lot!

Arno

prashil
Advisor
Advisor
0 Kudos

Hi Prerana,

I am not very sure about the solution.

If you have created a system created then i think you can easily specify the userid and password in the useradmin for particular user for connection to backend.

I think this could resolve the issue.

Regards,

Prashil