[cas-user] How to configure CAS with OPEN DS

319 views
Skip to first unread message

nayar

unread,
Sep 20, 2011, 9:16:27 PM9/20/11
to cas-...@lists.jasig.org
Hi All,
I am trying to implement CAS with Open DS using LDAP protocol. I followed "LDAP Authentication Handler" Doc.

What I did
**********

1. defined ContextSource in deployerConfigContext.xml of my $TOMCAT_HOME/webapp/WEB-INF/

2. Changed URL, userDn and password property to point to my openDS installation.

3. Modified authenticationManager bean in deployerConfigContext.xml to validate against LDAP.

Error
*****
With this I am getting HTTP Status 404 with The requested resource () is not available.


Question
********
1. I am not clear from Document if I need to rebuild the WAR file ?

2. If so how do I generate a new war file

Thanks

--
You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

b savage

unread,
Sep 20, 2011, 11:10:12 PM9/20/11
to cas-...@lists.jasig.org
Hi,

See below.

Brian

On Tue, Sep 20, 2011 at 9:16 PM, nayar <bwn...@yahoo.com> wrote:
Hi All,
  I am trying to implement CAS with Open DS using LDAP protocol. I followed "LDAP Authentication Handler" Doc.

What I did
**********

1. defined ContextSource in deployerConfigContext.xml of my $TOMCAT_HOME/webapp/WEB-INF/

2. Changed URL, userDn and password property to point to my openDS installation.

3. Modified  authenticationManager bean in deployerConfigContext.xml to validate against LDAP.

Error
*****
With this I am getting HTTP Status 404  with The requested resource () is not available.


Question
********
1. I am not clear from Document if I need to rebuild the WAR file ?

Yes, you should rebuild and redeploy your war file.

 
2. If so how do I generate a new war file

Use the "maven clean package" command in the top-level cas-server-[version] directory under which you've made your configuration changes.  This will rebuild the cas.war file that you will deploy.

To get most familiar with making changes and building, see this documentation:
https://wiki.jasig.org/display/CASUM/Best+Practice+-+Setting+Up+CAS+Locally+using+the+Maven2+WAR+Overlay+Method




Thanks

--
You are currently subscribed to cas-...@lists.jasig.org as: brianx...@gmail.com

To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user

Klas Wikblad

unread,
Sep 21, 2011, 2:34:59 AM9/21/11
to cas-...@lists.jasig.org
Hello!

Just started doing the exact same implementation as you. Mine is working although im stuck somewhere else. Signed up yesterday and wanted to ask so I guess I should earn some kharma-credits ;)

Id say you have some information in your logs. The cas service is probably unavailable due to a crash during startup. Most probably youre missing a jar or have some xml configuration error. Hard to tell without further info.

br
Klas

On Sep 21, 2011, at 03:16 AM, nayar wrote:

> Hi All,
> I am trying to implement CAS with Open DS using LDAP protocol. I followed "LDAP Authentication Handler" Doc.
>
> What I did
> **********
>
> 1. defined ContextSource in deployerConfigContext.xml of my $TOMCAT_HOME/webapp/WEB-INF/
>
> 2. Changed URL, userDn and password property to point to my openDS installation.
>
> 3. Modified authenticationManager bean in deployerConfigContext.xml to validate against LDAP.
>
> Error
> *****
> With this I am getting HTTP Status 404 with The requested resource () is not available.
>
>
> Question
> ********
> 1. I am not clear from Document if I need to rebuild the WAR file ?
>

> 2. If so how do I generate a new war file
>

> Thanks
>
> --
> You are currently subscribed to cas-...@lists.jasig.org as: klas.w...@heimore.com

nayar

unread,
Sep 21, 2011, 4:15:59 AM9/21/11
to cas-...@lists.jasig.org
Thanks Brian. I am able to build now. What is the new WAR file location ? I am not seeing any war files generated at /opt/cas/cas-server-3.4.10/modules

However, I am seeing a new cas.war file generated at opt/cas/cas-server-3.4.10/cas-server-webapp/target

I copied it to my tomcat directory and getting 404 error code.

Marvin Addison

unread,
Sep 21, 2011, 10:07:48 AM9/21/11
to cas-...@lists.jasig.org
> I copied it to my tomcat directory and getting 404 error code.

As Klas said, you're likely getting a 404 due to deployment errors.
Please review both your container logs (e.g.
$TOMCAT_HOME/logs/localhost.log, catalina.out) and the cas.log file
that is written to the current working directory by default.

M

nayar

unread,
Sep 21, 2011, 3:13:45 PM9/21/11
to cas-...@lists.jasig.org
Here is my error stack. This is what I did

As per https://wiki.jasig.org/display/CASUM/LDAP

1. Modify ${project.home}/cas-server-webapp/pom.xml

2. Modify deployerConfigContext.xml

3. Build maven clean package

4. copy ${project.home}/cas-server-webapp/target/cas.war
$TOMCAT/webapp

5. Now access using https://<host>/cas/login

Error Stack
******************

SEVERE: SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would not have initialized.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService' defined in ServletContext resource [/WEB-INF/spring-configuration/applicationContext.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 'usernameCredentialsResolver' while setting bean property 'credentialsToPrincipalResolvers' with key [0]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'usernameCredentialsResolver' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.be

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 'usernameCredentialsResolver' while setting bean property 'credentialsToPrincipalResolvers' with key [0]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'usernameCredentialsResolver' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)

Marvin Addison

unread,
Sep 22, 2011, 9:43:15 AM9/22/11
to cas-...@lists.jasig.org
> 1. Modify ${project.home}/cas-server-webapp/pom.xml
> 2. Modify deployerConfigContext.xml
> 3. Build maven clean package
> 4. copy ${project.home}/cas-server-webapp/target/cas.war
>   $TOMCAT/webapp
> 5. Now access using https://<host>/cas/login

The amount of support we can lend for this sort of deployment strategy
is limited. You've clearly got some bad component references in your
Spring context files, and possibly some additional missing
dependencies. You will have to manually debug these. We may be able
to point out problems if you post some or all of your configuration.
Posting to something like pastebin is helpful for reading XML.

I would strongly recommend you consider managing your configuration
and deployment via Maven war overlay:

https://wiki.jasig.org/display/CASUM/Best+Practice+-+Setting+Up+CAS+Locally+using+the+Maven2+WAR+Overlay+Method

In my experience using that alone solves many configuration and
dependency issues that we see initially on the list.

M

Dagmar Timler

unread,
Mar 20, 2013, 8:26:50 AM3/20/13
to jasig-c...@googlegroups.com, cas-...@lists.jasig.org, bwn...@yahoo.com
Hi

I also faced this error today and I'd like to point out that the instructions on that page are not very comprehensive. The examples at the bottom are only snippets from other Spring configuration files and have references to beans that aren't shown (e.g. usernameCredentialsResolver).

Pay attention to the authenticationManager and userDetailsService bean definitions.

Regards
Dagmar

Matt Vaughn

unread,
Jul 2, 2013, 6:08:42 PM7/2/13
to jasig-c...@googlegroups.com, cas-...@lists.jasig.org, bwn...@yahoo.com
I also encountered this today, following the instructions on https://wiki.jasig.org/display/CASUM/LDAP.

The instructions provided on the JASIG wiki are neither complete nor current, usually referencing much older versions of CAS. That's not doing the product any favors.
Reply all
Reply to author
Forward
0 new messages