jean-claude_bac
I'm new here

ConnectionManager get connection for already authenticated user

Jump to solution

I wrote a Service modul

public class PimImportServiceImpl implements PimImportService,

        de.espirit.firstspirit.module.Service<PimImportService> {

...

}

that imports data into a project opening a connection using the Connection Manager:

Connection connection = ConnectionManager.getConnection(host, port, ConnectionManager.HTTP_MODE,login, password);

to write data into the database of a FirstSpirit project.

The import of the data is triggered by a user that is already logged  into the CMS using  a beanshell script. I am looking for a way to avoid having a user to provide their password again as needed by the ConnectionManager interface.

Is there another way to handle that?

0 Kudos
1 Solution

Accepted Solutions
Peter_Jodeleit
Crownpeak employee

The interface Service has an "init" method which is called by FirstSpirit, providing a ServerEnvironment instanance. This in turn has a method "getConnection()". So there is no need to create a connection by yourself.

Peter

View solution in original post

0 Kudos
3 Replies
Peter_Jodeleit
Crownpeak employee

The interface Service has an "init" method which is called by FirstSpirit, providing a ServerEnvironment instanance. This in turn has a method "getConnection()". So there is no need to create a connection by yourself.

Peter
0 Kudos

Hi Peter,

but what if you need administrative rights - for example, to manipulate the FirstSpirit ProjectStorage without having logged in as a project or super admin?

Then you need to create a dedicated FirstSpirit connection providing:

- user name

- password

credential information on the client side.

If you wanna change the Super-Admin password later - you have to identify all client applications and change it there Smiley Sad

Thats really bad. How might this be solved? Because, retrieving the Admin-Password by API-calls is not possible as well (due to security reasons).

0 Kudos
feddersen
Community Manager

We already discussed a solution here: Centralizing Admin user information

0 Kudos