Experience Management

How to retrieve password for GSA connectors?

Sometimes you may need know the password used to configure a connector. Here is simple Java program that can be used to do that. Please note this only works for GSA 3.x connector.

public class DecrpytConnectorPassword {
    private static String fullPahtToCMKeyStore = "connector_manager.keystore";
    private static String fullPahtToConnectorPorperties = "myConnector.properties";
    public static void main(String[] args) throws Exception {
        EncryptedPropertyPlaceholderConfigurer.setKeyStoreType("JCEKS");
        EncryptedPropertyPlaceholderConfigurer.setKeyStoreCryptoAlgo("AES");
        EncryptedPropertyPlaceholderConfigurer.setKeyStorePath(fullPahtToCMKeyStore);
        String sPropFile = fullPahtToConnectorPorperties;
        File input = new File(sPropFile);
        InputStream fis = new FileInputStream(input);
        Properties props = new Properties();
        props.load(fis);
        fis.close();
        EncryptedPropertyPlaceholderConfigurer.decryptSensitiveProperties(props);
        props.list(System.out);
    }
}

The program assumed that you accepted the default setting when installing the connector manager. What you need provide are the full path to the Connector Manager’s keystore file, and the full path to the properties file that was created for the connector. When running the program, connector.jar from Google Connector Manager should be put into Java classpath. That’s it.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to the Weekly Blog Digest:

Sign Up
Follow Us
TwitterLinkedinFacebookYoutubeInstagram