Hi Vince,

you are mixing up stuff. You're encryptor in this case works as an
extension to the defined property placeholder. Your're trying to decrypt
the properties to initialize the encryptor. Split up the encryptor stuff
and the datasource stuff. Register a osgi service for StringEncryptor as
shown in my last answer and than do the register the datasource with
pax-jdbc-config. Pax-jdbc-config is looking for a registered service it
can use for decryption. This way you can share the encryptor for several
datasource definitions.

Regards,
Benjamin

Am 05.10.2016 um 23:06 schrieb Vince Iglehart:
> Benjamin,
>
> I implemented your suggestion.  I think that I am fairly close, yet running
> into some problems.  
>
> When I attempt to connect to use the datasource, I receive ORA-01017:
> invalid username/password; logon denied.  I think the problem is because I
> pull the password for Jasypt into a separate jasypt.properties file that
> will be accessible only to the user running Karaf.  However I don't know how
> to fix that.
>
> The following blueprint shows what I have for my datasource. 
>
> Would you have any other advice?
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>       xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";
>       xmlns:enc="http://karaf.apache.org/xmlns/jasypt/v1.0.0";>
>
>   
>   <ext:property-placeholder>
>     <ext:location>file:/oracle/jasypt.properties</ext:location>
>   </ext:property-placeholder>
>
>   <enc:property-placeholder>
>     <enc:encryptor
> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
>       <property name="config">
>         <bean class="org.jasypt.encryption.pbe.config.SimplePBEConfig">
>   
>           
>
>           <property name="algorithm" value="${jasaypt.algorithm}" />
>           <property name="password" value="${jasaypt.encryption.password}"
> />
>         </bean>
>       </property>
>     </enc:encryptor>
>   </enc:property-placeholder>
>
>   <bean id="dataSource" class="oracle.jdbc.pool.OracleDataSource">
>       <property name=&quot;URL&quot; value=&quot;&lt;url specified here>"/>
>       <property name=&quot;user&quot; value=&quot;&lt;user name here>"/>
>       <property name=&quot;password&quot; value=&quot;ENC(&lt;encrypted
> value here>)" />
>   </bean>
>   
>   <service interface="javax.sql.DataSource" ref="dataSource">
>     <service-properties>
>             <entry key="osgi.jndi.service.name" value="jdbc/oracleds"/>
>     </service-properties>
>   </service>
> </blueprint>
>
>
>
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Karaf-Datasource-Passwords-tp4048219p4048251.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to