cancel
Showing results for 
Search instead for 
Did you mean: 

Cas login redirecting to Alfresco login

goingcrazy
Champ in-the-making
Champ in-the-making
Hello everyone! I'm a new Alfresco poster and hopefully will be able to assist other people with their issues as I learn from my mistakes! I've configured two servers both on windows server 2008. One contains my CAS install and the other my alfresco install. Their ip addresses are cas.test1.test2.test3.com and alfresco.test1.test2.test3.com respectively. My CAS authenticates versus my active directory server ad.test1.test2.test3.com and the authentication process for AD works smoothly. I've modified my alfresco to redirect to CAS and authenticate versus AD; however, Once I login to CAS it redirects me to an alfresco dashboard but not logged in. There are two questions I have- 1) How do I SYNC alfresco's users with my LDAP AD and also why doesn't the CAS login send me to the page logged in as the  person in CAS (I've created the same user same password in both).

Versions I am on: Cas 3.4.6, Alfresco 34d
Steps I take:
1) Navigate to http://alfresco.test1.test2.test3.com:8080/alfresco
2) This redirects me to: http://cas.test1.test2.test3.com:8080/cas/login?service=http%3A%2F%2Falfresco.test1.test2.test3.com%...
3) If I enter a user name here that does not exist in the AD, it will deny me. If i enter a correct user name it sends a redirect with an address that looks like this:

http://alfresco.test1.test2.test3.com:8080/alfresco/faces/jsp/login.jsp?ticket=ST-1-SP76WiV1bHzowB1c...
      -I know this because the CAS.log shows all correct ticket granting info and then has a line in the tomcat log saying "Sending external redirect to the link:" and the link above

4) Instead of going to the redirect, it takes me to: http://alfresco.test1.test2.test3.com:8080/alfresco/faces/jsp/dashboards/container.jsp
and I am not logged in with my user name.

5) If I click login here, and enter the same username and password as the user i have in both AD and Alfresco it redirects me to my CAS login AGAIN and when I sign in here it redirects me to my ALFRESCO login AGAIN. and when I sign in here… It finally shows me as being logged in now. 

The log files do not have any errors being thrown… Does anyone have any suggestions or thoughts??

Also as I mentioned, I'd like to sync my AD and alfresco - I've had troubl efinding info on that because everyone does different things based on version and I don't see anything for 34d.

I can attach any files you need to assist in being able to help me out!

I greatly appreciate anyones comments!

Thanks All!
7 REPLIES 7

vandana_pal
Champ in-the-making
Champ in-the-making
Can you please share  what configuration you have done for  integrating CAS with Alfresco.
Have you done any filter configuration in web.xml  file of alfresco.

There is no relation with CAS when you sync alfresco and AD.
Check this Link : http://wiki.alfresco.com/wiki/Alfresco_Authentication_Subsystems
Gives you all the details for AD sync for alfresco v3.2 and greater. Hope this helps

goingcrazy
Champ in-the-making
Champ in-the-making
below is the modification i've put in the web.xml file on the alfresco tomcat.

I have CAS validating off of AD, i've manually entered a username/pw from both into alfresco so signing into cas with this person should redirect me to alfresco logged in…. on the CAS side of things everything is working! I'm really confused 😕 any additional advice would be appreciated!

<context-param>
<param-name>serverName</param-name>
<param-value>alfresco.test1.test2.test3.com:8080</param-value>
</context-param>
<filter>
<filter-name>CAS Authentication Filter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://cas.test1.test2.test3.com:8080/cas/login</param-value>
</init-param>
<init-param>
<param-name>service</param-name>
<param-value>http://alfresco.test1.test2.test3.com:8080/alfresco</param-value>
</init-param>
<init-param>
    <param-name>alfrescoServerName</param-name>
    <param-value>alfresco.test1.test2.test3.com:8080</param-value>

</init-param>
<init-param>
   <param-name>edu.yale.its.tp.cas.client.filter.wrapRequest</param-name>
   <param-value>true</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>http://cas.test1.test2.test3.com:8080/cas</param-value>
</init-param>
<init-param>
<param-name>redirectAfterValidation</param-name>
<param-value>true</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 Authentication Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CAS Validation 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>

goingcrazy
Champ in-the-making
Champ in-the-making
I'm no longer getting this occuring… i'm now able to login and it redirects me to the dashboard with the error javax.faces.FacesException: javax.faces.el.EvaluationException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
caused by:
org.apache.jasper.JasperException: javax.faces.el.EvaluationException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
caused by:
javax.faces.el.EvaluationException: Cannot get value for expression '#{NavigationBean.toolbarLocation}'
caused by:
javax.faces.el.EvaluationException: Exception getting value of property toolbarLocation of base of type : org.alfresco.web.bean.NavigationBean
caused by:
javax.faces.el.EvaluationException: Bean: org.alfresco.web.bean.NavigationBean, property: toolbarLocation
caused by:
java.lang.reflect.InvocationTargetException
caused by:
java.lang.NullPointerException

amitabhandari1
Champ in-the-making
Champ in-the-making
Hi GoingCrazy,

I would suggest to follow the following links:

1. http://wiki.alfresco.com/wiki/Central_Authentication_Service_Configuration
2.http://www.liferay.com/community/forums/-/message_boards/message/1073321;jsessionid=CA41F5E2B3416EC4...

You will get enough information from the links to configure cas .
I feel you have to modify your web.xml file.
Thanks,

goingcrazy
Champ in-the-making
Champ in-the-making
I went back and re-followed these guides and am now getting a new error in my log. I've done the directions as it suggests… i've modified my files and put that .jar file in the lib folder. Any thoughts?:

SEVERE: Exception starting filter Authentication Filter
java.lang.NoClassDefFoundError: org/alfresco/config/ConfigService
   at com.keembay.alfresco.web.app.servlet.CASAuthenticationFilter.init(CASAuthenticationFilter.java:251)
   at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
   at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
   at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
   at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
   at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
   at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
   at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:519)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.alfresco.config.ConfigService
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
   … 28 more

goingcrazy
Champ in-the-making
Champ in-the-making
I've read that

"Keembay lib failes because the alfresco-core-jar between 3.2r and 3.3 changed drastically, the class is missing this 2 classes:

import org.alfresco.config.ConfigService;
import org.alfresco.i18n.I18NUtil;"

Is this the issue I'm encountering? anyone know fix?

goingcrazy
Champ in-the-making
Champ in-the-making
I have resolve this issue- for those of you attempting to do this with alfresco explorer, the updated java file is located here: http://akselsarchitecture.blogspot.com/2010/09/cas-sso-for-alfresco-33-and-share.html

and there is a tutorial that has a link that has it already compiled and the code to change the filter located here: http://holisticsecurity.wordpress.com/2011/02/19/web-sso-between-liferay-and-alfresco-with-cas-and-p...

The "You can download the http://www.intix.info-casauthnfilter-0.1.jar file from here." is the first link's casauthfilter compiled into a jar. Use the 2nd link provided's filter code in your alfresco web.xml folder and put the jar downloaded into your alfresco webinf lib folder

If anyone knows where this jar file is for Share please let me know because I am having issues compiling the Share versions code.

Thanks all!