How to use CrowdSecurityFilter in Tomcat6?

Axel Apitz July 12, 2011

Hi,

i try to protect an application using the CrowdSecurityFilter as described in the documentation.

I added crowd-integration-client-2.2.7.jar and all jar's in lib from the client directory of the crowd pakage to my WEB-INF/lib directory.

Also i added the crowd.properties and crowd-ehcache.xml to my WEB-INF/classes diretory.

As last point i added:

<address><filter></address><address> <filter-name>CrowdSecurityFilter</filter-name></address><address> <filter-class>com.atlassian.crowd.integration.http.filter.CrowdSecurityFilter</filter-class></address><address></filter></address> <address><filter-mapping></address><address> <filter-name>CrowdSecurityFilter</filter-name></address><address> <url-pattern>/*</url-pattern></address><address></filter-mapping></address><address> </address>
to my web.xml
On Startup i get in tomcat
<address>Jul 13, 2011 2:53:24 PM org.apache.catalina.core.StandardContext filterStart</address><address>SEVERE: Exception starting filter CrowdSecurityFilter</address><address>java.lang.InstantiationException: com.atlassian.crowd.integration.http.filter.CrowdSecurityFilter</address><address> at java.lang.Class.newInstance0(Class.java:340)</address><address> at java.lang.Class.newInstance(Class.java:308)</address><address> at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)</address>
<address>...</address>
What is wrong? How do it right?
Best Regards,
Axel

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Ryan Cutter October 2, 2012

Something to add to Divya's answer: Make sure applicationContext-CrowdRestClient.xml is in your classpath. Even though I was including crowd-integration-client-rest.jar (v2.4.2) in my app, this file wasn't available (??). I had to drop the beans defined at https://developer.atlassian.com/display/CROWDDEV/Java+Integration+Libraries into my applicationContext.xml. Worked fine.

0 votes
Divya Arun August 4, 2011

Just sharing what I did.

I used crowd-integration-client-rest-2.2.4.jar and put it in WEB-INF/lib folder.

And used Spring security 3.0 and used Spring's Delegating filterproxy

<font style="color: #008080; font-size: x-small;" size="2" color="#008080"></font>

<

<font style="color: #008080; font-size: x-small;" size="2" color="#008080"></font>

context-param

>

<param-name>contextConfigLocation</param-name<font size="2" color="#008080"><font size="2" color="#008080">></font></font><param-value>

<u style="text-decoration: underline;"><font size="2">classpath</font></u>:/applicationContext-CrowdRestClient.xml

</param-value<font size="2" color="#008080"><font size="2" color="#008080">></font></font></context-param<font size="2" color="#008080"><font size="2" color="#008080">></font></font>

<filter>

<filter-name>crowdSecurityFilter</filter-name

<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>

</filter>

<filter-mapping>

<filter-name>crowdSecurityFilter</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

You have to give exact name with case since this is the bean defined in the jar's application context.

Kunal Chawla April 15, 2014

Hi Divya,

I am really struggling with this as the documentation currently sucks. I want to use Crowd for authentication and authorization for a simple webapp. Could you please point me in right direction.

Thanks!!

TAGS
AUG Leaders

Atlassian Community Events