Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] [equinox-dev] Eclipse Secure Storage Password - Suppressing the UI prompt

Hello,
In our eclipse based application, we are storing host, user name and
password (to connect to an external systems) in the Secure Storage and we
use "UI Prompt" as the master password provider.
When launching the application in interactive mode, secure storage
mechanism prompts for the master password and upon supplying the same I am
able to continue with the execution.
However, this application can also be run in a headless mode ( command line
execution). In the headless mode, when the application tries to retrieve
the user/password details from the secure storage, it throws an exception
(Embedded image moved to file: pic00960.gif)


The following is the code snippet that we use to retrieve the username/
password.

try {
        ISecurePreferences node = SecurePreferencesFactory
	.getDefault()
	.node(hostName);

        // Retrieve the password from secure storage using
<hostName>*<userName> as the key.
        String password = node.get(hostName + "*" + userName), null);
        // This call throws the exception when run in the headless mode.

        if (password != null)
	  return password;

} catch (Exception e) {
	e.printStackTrace();

}

We have multiple (hostName, username, password ) tuples to be stored and so
and it is absolutely important to store those and during the headless run,
we should be able to retrieve the data from the secure storage and continue
the execution without waiting for the user input.

Would somebody be able to guide on the recommended approach to handle this
scenario?

Regards, Vinod

Attachment: pic00960.gif
Description: GIF image


Back to the top