4 Replies Latest reply on Dec 18, 2006 8:22 AM by dileepprasad

    encrypted dsn connection in JBOSS

    dileepprasad

      Hi all
      I want to connect to my databse through JBOSS using encrypted password.I have already created a dsn and tried connecting to it after doing JBOSS encryption(reference link :-http://wiki.jboss.org/wiki/Wiki.jsp?page=EncryptingDataSourcePasswords).
      I have followed all the steps in the site but i am getting an error

      Invalid authentication attempt, principal=null

      can anyone help me to tell why is this error?

      Thanks in advance

      Cool

        • 1. Re: encrypted dsn connection in JBOSS
          weston.price

          This usually means you have spelled something incorrectly, or are using the incorrect login module. Could you please post your *-ds.xml file as well as your login-conf.xml file.

          • 2. Re: encrypted dsn connection in JBOSS
            dileepprasad

            Hi
            I have created the *ds.xml file as
            <?xml version="1.0" encoding="UTF-8"?>

            <local-tx-datasource>
            <jndi-name>betcdb2ds</jndi-name>
            <connection-url>jdbc:db2://db2connt.safeway.com:50000/DBU1</connection-url>
            <driver-class>com.ibm.db2.jcc.DB2Driver</driver-class>
            <min-pool-size>0</min-pool-size>

            <type-mapping>betcdb2ds</type-mapping>

            <!-- Use the security domain defined in conf/login-config.xml -->
            <security-domain>EncryptDBPassword</security-domain>
            </local-tx-datasource>


            and put an entry in login-config.xml i have added the entry


            <application-policy name = "EncryptDBPassword">

            <login-module code = "org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule"
            flag = "required">
            <module-option name = "username">BED1TC</module-option>
            <module-option name = "password">8Yan5EI.jO3</module-option>
            <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=betcdb2ds</module-option>
            <!-- <module-option name = "jaasSecurityDomain">jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</module-option>-->
            </login-module>

            </application-policy>

            and


            mbean code="org.jboss.security.plugins.JaasSecurityDomain"
            name="jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword">



            <!-- The opaque master password file used to decrypt the encrypted
            database password key -->
            {CLASS}org.jboss.security.plugins.FilePassword:${jboss.server.home.dir}/conf/server.password
            abcdefgh
            13


            Is there anything wrong here

            Cool

            • 3. Re: encrypted dsn connection in JBOSS
              weston.price

              Try uncommenting the line

              <!-- <module-option name = "jaasSecurityDomain">jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</module-option>-->
              
              


              Looks like something is not being read right.



              • 4. Re: encrypted dsn connection in JBOSS
                dileepprasad

                Hi
                This gives me an error

                UsersRolesLoginModule: Failed to load users/passwords/role files
                java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found

                is there any file i have to create???

                Cool