JasperServer 3.7 ApplicationContext-security.xml edit

nepco
nepco used Ask the Experts™
on
:  I have incorporated JasperServer 3.7 into my web application using the HTTP API, but I want to disable or change the encryption method used by JasperServer so it can match my web application method. However, whenever I edit this file and save it, it becomes corrupted...even if I save it as the original version and JasperServer will not start.

I have tried to comment out the passwordEncoder property under the "daoAuthenticationProvider" bean and have also tried to "allowEncoding" to false. I have also tried this with JasperServer 3.5 with no success and the same trouble.


Many thanks.
<!-- ======================== AUTHENTICATION ======================= -->
    <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
        <property name="providers">
            <list>
                <!-- not on by default <ref local="ldapAuthenticationProvider"/>  -->
                <ref bean="${bean.daoAuthenticationProvider}"/>
                <ref local="anonymousAuthenticationProvider"/>
                <!--ref local="jaasAuthenticationProvider"/-->
            </list>
        </property>
    </bean>
    
    <bean id="daoAuthenticationProvider" class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
        <!-- jdbcDaoImpl --> 
        <!-- <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property> -->
        <property name="userDetailsService"><ref bean="${bean.internalUserAuthorityService}"/></property>
        <property name="passwordEncoder"><ref local="passwordEncoder"/></property>
    </bean>
    
    <bean id="passwordEncoder" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.PasswordCipherer" lazy-init="false">
        <property name="allowEncoding"><value>true</value></property>
        <property name="keyInPlainText"><value>false</value></property>
        <property name="secretKey"><value>0xC8 0x43 0x29 0x49 0xAE 0x25 0x2F 0xA1 0xC1 0xF2 0xC8 0xD9 0x31 0x01 0x2C 0x52 0x54 0x0B 0x5E 0xEA 0x9E 0x37 0xA8 0x61</value></property>
        <property name="secretKeyAlgorithm"><value>DESede</value></property>
        <property name="cipherTransformation"><value>DESede/CBC/PKCS5Padding</value></property>
    </bean>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mick BarryJava Developer
Top Expert 2010

Commented:
whats the error, how is it corrupted exactly?

Author

Commented:
If I change allowEncoding to false, Tomcat reports the following error:

ERROR ContextLoader,main:215: - Context initialization failed org.springframework.beans.factory.xml.XmlBeanDefinitiionStoreException: Line 157 in XML document from ServletContext resourse [/WEB-INF/app.icationContext-security.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The string "--" is not permitted within comments.

Viewing the document in a browser tells me the Incorrect syntax was used, but all I'm doing is changing the boolean.

Like I said before, I could change it back to true before I save it and it still generates the same error.
HI,

please find the below code and try. Let me know if you still having issues?
<!-- ======================== AUTHENTICATION ======================= -->
    <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
        <property name="providers">
            <list>
                <!-- not on by default <ref local="ldapAuthenticationProvider"/>  -->
                <ref bean="${bean.daoAuthenticationProvider}"/>
                <ref local="anonymousAuthenticationProvider"/>
                <!--<ref local="jaasAuthenticationProvider"/>-->
            </list>
        </property>
    </bean>
    
    <bean id="daoAuthenticationProvider" 

class="org.springframework.security.providers.dao.DaoAuthenticationProvider">
        <!-- jdbcDaoImpl --> 
        <!-- <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property> -->
        <property name="userDetailsService"><ref bean="${bean.internalUserAuthorityService}"/></property>
        <property name="passwordEncoder"><ref local="passwordEncoder"/></property>
    </bean>
    
    <bean id="passwordEncoder" class="com.jaspersoft.jasperserver.api.metadata.common.service.impl.PasswordCipherer" 

lazy-init="false">
        <property name="allowEncoding"><value>true</value></property>
        <property name="keyInPlainText"><value>false</value></property>
        <property name="secretKey"><value>0xC8 0x43 0x29 0x49 0xAE 0x25 0x2F 0xA1 0xC1 0xF2 0xC8 0xD9 0x31 0x01 0x2C 

0x52 0x54 0x0B 0x5E 0xEA 0x9E 0x37 0xA8 0x61</value></property>
        <property name="secretKeyAlgorithm"><value>DESede</value></property>
        <property name="cipherTransformation"><value>DESede/CBC/PKCS5Padding</value></property>
    </bean>

Open in new window

Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Author

Commented:
Yeah, I still have the same problem after trying that code.
if you don't need below statements remove them and try again
                <!--<ref local="jaasAuthenticationProvider"/>-->
        <!-- <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property> -->
Commented:
Thanks for the help everyone. It just turned out to be because I was editing the file in Dreamweaver. I changed the file in Notepad++ instead.
Mick BarryJava Developer
Top Expert 2010

Commented:
best to avoid dreamweaver for editting xml :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial