Results 1 to 2 of 2

Thread: Storing database credentials for RCP application

  1. #1
    Join Date
    Jan 2005
    Location
    Wellington, New Zealand
    Posts
    17

    Default Storing database credentials for RCP application

    Hi all,
    I'm developing an Eclipse RCP application that uses five separate databases & ldap. It'll be deployed via WebStart into our internal network from an instance of WebSphere. The problem is that storing unsecured credentials for use by BasicDataSource's & Spring LDAP are a security issue. This is obviously not an option to deploy with.

    What are your suggestions as how to solve this problem?
    Cheers
    Last edited by glenn2041; Nov 2nd, 2008 at 08:00 PM.

  2. #2
    Join Date
    Nov 2008
    Posts
    6

    Default

    You can use the BasicTextEncryptor to encrypt the password in a properties file that the BasicDataSource is configured to use

    Code:
    <bean id="fillInProperties" class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer">
    		<constructor-arg ref="BasicTextEncryptor"/>
    		<property name="location">
    			<value>resources/site.properties</value>
    		</property>
    	</bean>
    
    	<bean id="BasicTextEncryptor" class="org.jasypt.util.text.BasicTextEncryptor">
    		<property name="password">
    			<value>psW%$enc6</value>
    		</property>
    	</bean>
    
    
    	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    		<property name="driverClassName">
    			<value>oracle.jdbc.driver.OracleDriver</value>
    		</property>
    		<property name="url">
    			<value>${ds.url}</value>
    		</property>
    		<property name="username">
    			<value>${ds.username}</value>
    		</property>
    		<property name="password">
    			<value>${ds.password}</value>
    		</property>
    	</bean>

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •