Encoding problem with APEX app builder caused by CAS

三世轮回 提交于 2020-04-18 03:46:12

问题


I have a problem with APEX app builder/sql workshop for a while. There is a encoding issue (APEX must serve EastEuropean chars). Finnaly i found the source of the issue. I have implemented a CAS sso into APEX thru web.xml (APEX is on Tomcat/ORDS). Without CAS evrything is working fine, but i need it.

Below there is the web.xml configuration.


    <filter>
        <filter-name>CAS Single Sign Out Filter</filter-name>
        <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
        <init-param>
            <param-name>casServerUrlPrefix</param-name>
            <param-value>**************</param-value>
        </init-param>
    </filter>
        <filter-mapping>
        <filter-name>CAS Single Sign Out Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>




    <listener>
        <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
    </listener>

    <filter>
        <filter-name>CAS Authentication Filter</filter-name>
        <filter-class>org.jasig.cas.client.authentication.Saml11AuthenticationFilter</filter-class>

        <init-param>
            <param-name>casServerLoginUrl</param-name>
            <param-value>****************</param-value>
        </init-param>
        <init-param>
            <param-name>serverName</param-name>
            <param-value>***************</param-value>
        </init-param>
        </filter>

    <filter>
        <filter-name>CAS Validation Filter</filter-name>
        <filter-class>org.jasig.cas.client.validation.Saml11TicketValidationFilter</filter-class>

        <init-param>
            <param-name>casServerUrlPrefix</param-name>
            <param-value>****************</param-value>
        </init-param>
        <init-param>
            <param-name>serverName</param-name>
            <param-value>*************</param-value>
        </init-param>
        <init-param>
            <param-name>redirectAfterValidation</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>useSession</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>acceptAnyProxy</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>proxyReceptorUrl</param-name>
            <param-value>/apex/proxyUrl</param-value>
        </init-param>
        <init-param>
            <param-name>proxyCallbackUrl</param-name>
            <param-value>*************</param-value>
        </init-param>

        <init-param>
            <param-name>tolerance</param-name> 
            <param-value>12000</param-value> 
        </init-param> 
        <init-param>
            <param-name>authn_method</param-name>
            <param-value>mfa-duo</param-value>
        </init-param>
    </filter>

    <filter>
        <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
        <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
    </filter>





    <filter-mapping>
        <filter-name>CAS Validation Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>CAS Authentication Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


I tried to implement something from https://github.com/apereo/java-cas-client/blob/master/README.md for example there is a sentence

The SingleSignOutFilter can affect character encoding. This becomes most obvious when used in conjunction with applications such as Atlassian Confluence. It's recommended you explicitly configure either the VT Character Encoding Filter or the Spring Character Encoding Filter with explicit encodings.

But I don't know how to implement it. When I tried to implement below code, this filter don't event start properly and I can't check logs of error.

    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>

    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

Example of issue: SQL workshop>

select 'ł' from dual;

result: A?

How can I fix this?


回答1:


Adding the CharackerEncodingFilter to web.xml was correct. I found the logs and I noticed that there was a problem with missing classes.

There was requirment to add some .jar to WEB-INF/lib

  • org.springframework.beans
  • org.springframework.context
  • spring-web
  • org.springframework.core

After tomcat restart everything works fine



来源:https://stackoverflow.com/questions/60830692/encoding-problem-with-apex-app-builder-caused-by-cas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!