Link to home
Start Free TrialLog in
Avatar of nepco
nepcoFlag for United States of America

asked on

JasperServer 3.7 ApplicationContext-security.xml edit

:  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

Avatar of Mick Barry
Mick Barry
Flag of Australia image

whats the error, how is it corrupted exactly?
Avatar of nepco

ASKER

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

Avatar of nepco

ASKER

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> -->
ASKER CERTIFIED SOLUTION
Avatar of nepco
nepco
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
best to avoid dreamweaver for editting xml :)