cancel
Showing results for 
Search instead for 
Did you mean: 

CAS SSO HTTPRequestAuthenticationFilter problems

aleksei
Champ in-the-making
Champ in-the-making
Hello
I have Alfresco installed as servlet on Tomcat.
I want to configure it to work with my CAS server to get SSO with over servlets. I try to use HTTPRequestAuthenticationFilter but with no success.

I have this in my web.xml

<filter>
      <filter-name>HTTP Request Authentication Filter</filter-name>
      <filter-class>org.alfresco.web.app.servlet.HTTPRequestAuthenticationFilter</filter-class>
   </filter>

After restarting Tomcat i have this exception in log
17:53:14,796 ERROR [org.apache.catalina.core.ContainerBase.[Catalina].[portal.niiit-rts.ru].[/alfresco]] Exception starting filter HTTP Request Authentication Filter
java.lang.InstantiationException: org.alfresco.web.app.servlet.HTTPRequestAuthenticationFilter
        at java.lang.Class.newInstance0(Class.java:335)
        at java.lang.Class.newInstance(Class.java:303)
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:210)
        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:304)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:77)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3634)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4217)
        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1089)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1187)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:292)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1305)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1569)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1558)
        at java.lang.Thread.run(Thread.java:595)

Who try to use HTTPRequestAuthenticationFilter? Please, share your experience.
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

Which version of LAfresco are you using?
You also need a CAS filter wired up before this one.

Andy

jzulu2000
Champ in-the-making
Champ in-the-making
Hi

This is because the org.alfresco.web.app.servlet.HTTPRequestAuthenticationFilter class  has no 'no arg' constructor, so it can not be instantiated using the Class.newInstance() method.

You can develop a class extending org.alfresco.web.app.servlet.HTTPRequestAuthenticationFilter and use this new class as your Filter.

package co.com.arkimia.filters;
public class MyHTTPRequestAuthenticationFilter extends org.alfresco.web.app.servlet.HTTPRequestAuthenticationFilter {
  public MyHTTPRequestAuthenticationFilter() {
    super("x-user");
  }
}


Now, in the web.xml, just use the new class


<filter>
      <filter-name>Authentication Filter</filter-name>
      <filter-class>co.com.arkimia.filters.MyHTTPRequestAuthenticationFilter</filter-class>
</filter>
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.