Si vous avez déjà installé Alfresco 3.0, vous vous êtes sûrement rendu compte que les deux applications Share et Alfresco gèrent leur authentification indépendamment l’une de l’autre. Si vous passez de Share à Alfresco (et inversement), vous devez de nouveau montrer patte blanche en donnant votre nom d’utilisateur et votre mot de passe … ce qui est particulièrement frustrant pour nos utilisateurs. Que faire ? Mettre en place un système de SSO et CAS répond très bien à ce problème.
# Principes d’authentification de Share et de CAS
Je ne vais pas revenir sur l’installation et la configuration d’un serveur CAS. Ceci n’est pas l’objet de ce billet. Nous verrons uniquement comment CASifier Share (ce qui va déjà nous occuper un petit moment).
Je vais revenir rapidement sur le principe d’authentification de Share pour bien exposer le problème :
- l’utilisateur ouvre l’application Share
- Share affiche la page de login
- l’utilisateur envoie le couple login / mot de passe
- ce couple est envoyé vers un webscript Alfresco par Share
- si Alfresco valide le couple, il renvoie un ticket
- Share utilisera ce ticket pour toutes les futures communications avec Alfresco
Ceci montre que le mot de passe donné sur la page de login de Share est ensuite envoyé à Alfresco. C’est la réponse d’Alfresco qui conditionne l’accès (ou non) à l’application Share.
Une application CASifiée utilise le principe suivant pour authentifier un utilisateur :
- connexion de l’utilisateur à l’application (il n’a pas encore de ticket CAS valide)
- l’application le renvoie vers la page de login de CAS
- l’utilisateur envoie le couple login / mot de passe à CAS
- ce couple est validé par le backend de CAS
- si le couple est valide, CAS redirige l’utilisateur vers l’application accompagné d’un ticket ST (Service cket)
- l’application valide le ticket ST auprès de CAS et récupère le login de l’utilisateur
- l’application authentifie l’utilisateur uniquement sur le login
De ces deux procédures d’authentification, on peut déjà faire ressortir le principale problème : l’application CASifiée ne voit jamais le mot de passe de l’utilisateur. Dans ce cas comment Share peut-il envoyer le couple login / mot de passe à Alfresco ?
# Quelles sont les solutions ?
Une première piste serait d’utiliser notre ticket ST dans Share et l’envoyer à la place du mot de passer à Alfresco. Il faudrait réaliser des modifications côté Alfresco pour valider ce ticket ST auprès du serveur CAS. Cependant, cela ne peut fonctionner car un ticket ST est à usage unique. Il est invalidé côté CAS après la validation de Share, il ne peut donc plus être utilisé par Alfresco.
La seconde piste (qui sera la bonne) est l’utilisation d’un Proxy Ticket (PT). Le système de proxy a été introduit dans CAS 2, il faudra donc utiliser un serveur et un client supportant cette architecture.
Si on reprend la procédure d’authentification de CAS avec l’utilisation d’un PT, cela devient :
- connexion de l’utilisateur à Share (il n’a pas encore de ticket CAS valide)
- Share le renvoie vers la page de login de CAS
- l’utilisateur envoie le couple login / mot de passe à CAS
- ce couple est validé par le backend de CAS
- si le couple est valide, CAS redirige l’utilisateur vers Share accompagné d’un ticket ST (Service Ticket)
- Share valide le ticket ST auprès de CAS et demande un PGT (Proxy Granting Ticket)
- CAS renvoie le login de l’utilisateur et un PGT
- Share demande un PT (Proxy Ticket) à CAS à l’aide du PGT
- CAS renvoie le PT
- Share envoie le PT à Alfresco via un webscript
- Alfresco valide le PT via CAS et récupère le login
- Alfresco crée un ticket (un ticket Alfresco, pas un ticket CAS) et le renvoie à Share pour les futures échanges
Ouf ! C’est un peu long, mais ça fonctionne et c’est totalement transparent pour les utilisateurs.
Bon, on a un principe qui est fonctionnel, il ne nous reste plus qu’à passer au plus intéressant : la réalisation.
# En pratique…
En pratique, il faut modifier Share et Alfreso. Des modifications des deux côtés sont nécessaires pour mettre en place le SSO. Les modifications se résument à quelques fichiers Java et beaucoup de XML.
# Côté Share
- web.xml : ajouter les filtres pour CAS
- webscript-framework-config.xml : modification de classe d’authentification (envoie du PT à la place du mot de passe sur un nouveau webscript)
- ajouter le jar du client CAS
- ajouter deux nouvelles classes Java :
- CasAuthenticationFilter : valide le ST, récupère le PT et authentifie l’utisateur dans Share
- CasAlfrescoAuthenticator : envoie le PT vers un webscript Alfresco et récupère un ticket Alfresco
# Côté Alfresco
- web.xml : ajouter les filtres pour CAS
- ajouter le jar du client CAS
- ajouter le webscript recevant le PT de Share
- ajouter la classe Java pour l’authentification CAS classique
# Le code
Ces deux archives contiennent tout le code et les modifications nécessaires pour mettre en place un SSO basé sur CAS entre Share et Alfresco. Avant d’utiliser ces fichiers, il faut les modifier pour correspondre à votre installation (notamment les adresses des serveurs CAS et Alfresco).
10 février 2009 at 3 h 10 min
Hi
Thanks for posting this!
I’m trying your solution on Alfresco version 3c
I’m sorry for not writing in french ( I don’t have the skill)
I noticed that you are not building an AMP file for the share-cas. Your build.xml only creates jar file. Do I need an amp file?, I mean how is that the web.xml and the webscript-framework-config.xml will be applied to share without an amp?
Also, which version of Alfresco your solution was tested with?
Thanks A lot,
Paulo A.
20 février 2009 at 10 h 12 min
Hi Paulo,
Unfortunately, there is no AMP-like system for Alfresco Share (please see: http://forums.alfresco.com/en/viewtopic.php?f=48&t=15371). You have to copy or modify files by hand directly on your installation.
This solution was tested with Alfresco Enterprise 3.0.1.
Best Regards,
Laurent
24 février 2009 at 11 h 27 min
Bonjour,
Merci pour ce système (et l’explication du protocole de proxy CAS).
J’ai cependant un problème avec, je me retrouve avec des problèmes d’encodage de caractères. Si dans Alfresco je tape « éàù », le formulaire étant encodé en utf-8, les caractères accentués sont encodés sur deux octets (j’ai donc 6 octets au total).
Une fois arrivé dans Alfresco, je me retrouve avec 6 caractères (« éà ù »)… Nos caractères sont récupérés comme s’il s’agissait d’iso-8859-1.
Retirer le SSO CAS revient bien à la normale, de même que mettre les filtres CAS (auth + validation) mais remettre le filtre d’auth alfresco de base (= ne pas récupérer le login de l’utilisateur depuis cas, mais le forcer à ressaisir son login/password dans Alfresco).
Problème vu sur Alfresco 3 Stable et sur l’entreprise 3.0.1.
Est-ce que vous avez eu le même genre de soucis ? Si oui, est-ce que vous avez pu le résoudre ? (Je n’ai rien trouvé sur les mailing lists de CAS, à part quelqu’un qui a eu le même problème, sans réponse)
Merci beaucoup pour vos réponses !
24 février 2009 at 16 h 58 min
Bonjour Sylvain,
Je n’ai jamais rencontré de problème d’encodage provoqué par l’utilisation de CAS. Ce qui me semble bizarre c’est que ton problème apparaisse uniquement lors de l’activation des filtres CAS. J’avoue ne pas voir de lien entre les deux et du coup je n’ai pas de réponse à te donner…
Beaucoup de paramètres entrent en jeu… Est-ce que tu attaques directement Tomcat ou est-ce que tu passes par Apache (mod_proxy ou mod_jk) ? Environnement Linux ou Windows ? Quelle locale est utilisée ? Etc.
Bref, ce n’est pas si simple. Je te conseille d’ouvrir un nouveau sujet sur le forum francophone alfresco (http://forums.alfresco.com/fr/), tu y trouveras des personnes compétentes qui pourront certainement répondre à ton problème.
28 février 2009 at 5 h 05 min
Bonjour,
j’ai un problème lorsque j’essaie cette configuration :
la connection sur share redirige bien vers le serveur cas
mais apres l’authentification je suis redirigé vers la page d’erreur suivante :
ERROR HTTP/500
javax.servlet.ServletException: org.jasig.cas.client.validation.TicketValidationException:
le ticket ‘ST-7-qWosEmHtaghenRsf7BCv-cas’ ne correspond pas au service demandé
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:155)
cause mère
org.jasig.cas.client.validation.TicketValidationException:
le ticket ‘ST-7-qWosEmHtaghenRsf7BCv-cas’ ne correspond pas au service demandé
org.jasig.cas.client.validation.Cas20ServiceTicketValidator.parseResponseFromServer(Cas20ServiceTicketValidator.java:73)
org.jasig.cas.client.validation.AbstractUrlBasedTicketValidator.validate(AbstractUrlBasedTicketValidator.java:188)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:132)
de plus l’adresse de retour et de type http://alfresco.sample.org/share/share/?ticket=ST-7-qWosEmHtaghenRsf7BCv-cas
Une idée du problème ?
13 mai 2009 at 0 h 02 min
Thanks for the code.
It works great with Alfresco Explorer. But I do have the following error on Alfresco Share:
HTTP Status 500 –
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.alfresco.error.AlfrescoRuntimeException: Unable to retrieve object: slingshot.site.configuration of type: configuration
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:140)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getConfiguration(Model.java:141)
org.alfresco.web.site.AbstractRequestContext.getSiteConfiguration(AbstractRequestContext.java:138)
org.alfresco.web.site.AbstractPageMapper.postExecute(AbstractPageMapper.java:90)
org.alfresco.web.site.AbstractPageMapper.execute(AbstractPageMapper.java:65)
org.alfresco.web.site.DefaultRequestContextFactory.newInstance(DefaultRequestContextFactory.java:109)
org.alfresco.web.site.FrameworkHelper.initRequestContext(FrameworkHelper.java:188)
org.alfresco.web.site.RequestUtil.getRequestContext(RequestUtil.java:76)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
org.alfresco.web.framework.exception.ModelObjectPersisterException: Error loading object id: slingshot.site.configuration from persister id: RemoteStore_alfresco/site-data/configurations_configuration
org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:110)
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getConfiguration(Model.java:141)
org.alfresco.web.site.AbstractRequestContext.getSiteConfiguration(AbstractRequestContext.java:138)
org.alfresco.web.site.AbstractPageMapper.postExecute(AbstractPageMapper.java:90)
org.alfresco.web.site.AbstractPageMapper.execute(AbstractPageMapper.java:65)
org.alfresco.web.site.DefaultRequestContextFactory.newInstance(DefaultRequestContextFactory.java:109)
org.alfresco.web.site.FrameworkHelper.initRequestContext(FrameworkHelper.java:188)
org.alfresco.web.site.RequestUtil.getRequestContext(RequestUtil.java:76)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
org.alfresco.web.framework.exception.ModelObjectPersisterException: Failure to load model object for path: slingshot.site.configuration.xml
org.alfresco.web.framework.StoreModelObjectPersister.getObjectByPath(StoreModelObjectPersister.java:170)
org.alfresco.web.framework.StoreModelObjectPersister.getObject(StoreModelObjectPersister.java:108)
org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:106)
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getConfiguration(Model.java:141)
org.alfresco.web.site.AbstractRequestContext.getSiteConfiguration(AbstractRequestContext.java:138)
org.alfresco.web.site.AbstractPageMapper.postExecute(AbstractPageMapper.java:90)
org.alfresco.web.site.AbstractPageMapper.execute(AbstractPageMapper.java:65)
org.alfresco.web.site.DefaultRequestContextFactory.newInstance(DefaultRequestContextFactory.java:109)
org.alfresco.web.site.FrameworkHelper.initRequestContext(FrameworkHelper.java:188)
org.alfresco.web.site.RequestUtil.getRequestContext(RequestUtil.java:76)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
java.lang.NullPointerException
org.alfresco.util.URLEncoder.encode(URLEncoder.java:106)
org.alfresco.util.URLEncoder.encode(URLEncoder.java:178)
com.atolcd.alfresco.CasAlfrescoAuthenticator.authenticate(Unknown Source)
org.alfresco.connector.AuthenticatingConnector.handshake(AuthenticatingConnector.java:384)
org.alfresco.connector.AuthenticatingConnector.call(AuthenticatingConnector.java:115)
org.alfresco.web.scripts.RemoteStore.callGet(RemoteStore.java:694)
org.alfresco.web.scripts.RemoteStore.hasDocument(RemoteStore.java:344)
org.alfresco.web.framework.StoreModelObjectPersister.getObjectByPath(StoreModelObjectPersister.java:136)
org.alfresco.web.framework.StoreModelObjectPersister.getObject(StoreModelObjectPersister.java:108)
org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:106)
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getConfiguration(Model.java:141)
org.alfresco.web.site.AbstractRequestContext.getSiteConfiguration(AbstractRequestContext.java:138)
org.alfresco.web.site.AbstractPageMapper.postExecute(AbstractPageMapper.java:90)
org.alfresco.web.site.AbstractPageMapper.execute(AbstractPageMapper.java:65)
org.alfresco.web.site.DefaultRequestContextFactory.newInstance(DefaultRequestContextFactory.java:109)
org.alfresco.web.site.FrameworkHelper.initRequestContext(FrameworkHelper.java:188)
org.alfresco.web.site.RequestUtil.getRequestContext(RequestUtil.java:76)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
Any clues will be greatly appreciated.
Thanks,
Hongbo
25 mai 2009 at 16 h 17 min
Bonjour,
Je suis en train d’essayer de CASifier Alfresco Share, néanmoins je rencontre un problème en suivant votre démarche. En effet, je n’arrive pas à ajouter les classes CasAuthenticationFilter et CasAlfrescoAuthenticator à Alfresco Share. Lorsque je lance la commande ant pour créer le jar avec les classes compilées, le paramètre -Dsdk.dir est requis, mais je ne sais pas sur quel répertoire pointer. Pourriez-vous m’éclairer sur ce point?
Merci par avance.
25 mai 2009 at 16 h 52 min
Bonjour
j’ai intégré cette solution exactement comme vous l’avez précisé, sauf j’ai rencontré une exception à pour gueule :
GRAVE: « Servlet.service() » pour la servlet Faces Servlet a g�n�r� une exception
java.lang.NullPointerException
at com.atolcd.alfresco.CasAuthenticationFilter.doFilter(CasAuthenticationFilter.java:115)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChai
merci d’avance pour votre aide
Alain
25 juin 2009 at 20 h 14 min
Merci pour ce post, qui semble très bien marcher.
Nous ne pouvons malheureusement le valider jusqu’au bout, puisque nous restons bloqué sur de la configuration purement cas…
Auriez vous un exemple de configuration spring et web.xml pour supporter les Proxy Ticket dans cas/cas-web ?
Merci beaucoup.
3 juillet 2009 at 23 h 05 min
I get an error when I try log into alfresco share with the above config for CAS. I am able to log into alfresco with CAS.
The error I get when I try to log into share:
org.alfresco.web.scripts.WebScriptException: 06030051 Wrapped Exception (with st
atus template): 06030050 Error during processing of the template ‘Expression tic
ket is undefined on line 2, column 11 in com/atolcd/alfresco/logincas.get.xml.ft
l.’. Please contact your system administrator.
at org.alfresco.web.scripts.AbstractWebScript.createStatusException(Abst
ractWebScript.java:613)……
Am I missing something .I changed the cas url in all the place (both xml and java files)
4 juillet 2009 at 1 h 33 min
Great stuff ,please ignore the above error message posted by me ,it was my bad ,I did not change the cas url in one of the java files .Everything work perfectly fine .
Really great stuff .Thanks a lot for posting
It works on alfresco 3.2 preview too 🙂
We get the url encoding error bcos of improper configuration .If the CAS service url does not match you may get the url encoding error ,there are other reasons too .Make sure to edit all the java and xml files with proper cas url.
10 juillet 2009 at 9 h 39 min
Bonjour,
Pouvez-vous dire si cette implémentation est compatible avec les versions 3.2 d’Alfresco et de Share qui viennent de sortir ? Sinon à quelle date pensez vous proposer une solution ?
Cordialement
16 juillet 2009 at 20 h 26 min
Bonjour Laurent,
Je ne suis pas sure de la procedure a suivre pour la modification de web.xml (celui d’Alfresco, pas de Share). Faut-il remplacer les filtres/mappings actuels par les votres, ou faut-il ajouter? (et dans ce cas, avant ou apres?)
Merci.
17 juillet 2009 at 22 h 02 min
Merci pour votre contribution a Alfresco!
J’ai une erreur 500, et me voila a nouveau bloque. Cela survient lorsque j’essaye de me connecter a Share. Je suis bien transfere sur le CAS, je m’authentifie, et je suis ensuite redirige sur Share. Et l’erreur 500 survient. Pourtant le CAS marche avec Alfresco.
[code]description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.alfresco.error.AlfrescoRuntimeException: 06170001 Unable to retrieve object: default of type: theme
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:140)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getTheme(Model.java:225)
org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
org.alfresco.web.framework.exception.ModelObjectPersisterException: Error loading object id: default from persister id: RemoteStore_alfresco/site-data/themes_theme
org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:110)
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getTheme(Model.java:225)
org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
org.alfresco.web.framework.exception.ModelObjectPersisterException: Failure to load model object for path: default.xml
org.alfresco.web.framework.StoreModelObjectPersister.getObjectByPath(StoreModelObjectPersister.java:170)
org.alfresco.web.framework.StoreModelObjectPersister.getObject(StoreModelObjectPersister.java:108)
org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:106)
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getTheme(Model.java:225)
org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
java.lang.NullPointerException
org.alfresco.util.URLEncoder.encode(URLEncoder.java:106)
org.alfresco.util.URLEncoder.encode(URLEncoder.java:178)
com.atolcd.alfresco.CasAlfrescoAuthenticator.authenticate(Unknown Source)
org.alfresco.connector.AuthenticatingConnector.handshake(AuthenticatingConnector.java:407)
org.alfresco.connector.AuthenticatingConnector.handshakeOrGuest(AuthenticatingConnector.java:308)
org.alfresco.connector.AuthenticatingConnector.call(AuthenticatingConnector.java:117)
org.alfresco.web.scripts.RemoteStore.callGet(RemoteStore.java:694)
org.alfresco.web.scripts.RemoteStore.hasDocument(RemoteStore.java:344)
org.alfresco.web.framework.StoreModelObjectPersister.getObjectByPath(StoreModelObjectPersister.java:136)
org.alfresco.web.framework.StoreModelObjectPersister.getObject(StoreModelObjectPersister.java:108)
org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:106)
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getTheme(Model.java:225)
org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
[/code]
Merci de votre aide.
7 septembre 2009 at 11 h 04 min
Hi,
I am trying to integrate cas with alfresco share. I have followed the steps which you have mentioned in this doc.
But we are facing the below error.
rg.alfresco.error.AlfrescoRuntimeException: Unable to retrieve object: default of type: theme
org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:140)
org.alfresco.web.site.Model.getObject(Model.java:513)
org.alfresco.web.site.Model.getTheme(Model.java:225)
org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:246)
org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:153)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
Can anyone help me in above.
Thanks in advance,
Sharmila
14 septembre 2009 at 21 h 22 min
I hit the same problem. Anyone expert can help ?
28 septembre 2009 at 16 h 46 min
Finally, I found the solution. The hostname must be same.
27 octobre 2009 at 17 h 36 min
Laurent, this is very helpful, but I have some questions (since I could not quite make this work yet):
How does the proxyCallbackUrl and proxyReceptorUrl work? In your web.xml for Share, you set the proxyCallbackUrl to share/proxyCallback, but this is not a service that Alfresco defines by default. So is there something else to be configured to allow the callback to be handled by Alfresco?
The problem I’m having is that the proxy-ticket-iou is generated, but this is never translated to a proxy-ticket (so I keep getting No Proxy Ticket Found for PGTIOU-…). I believe this is because the proxy connection between CAS and Alfresco is somehow not working (presumably this is the proxyCallbackUrl and proxyReceptorUrl setting).
Thanks
14 décembre 2009 at 11 h 28 min
Hello Lawrence,
Sorry for not posting in french language. Unfortunatelly I do not know this language well enough.
First of all thanks for your contribution!
I can successfull compile alfresco-cas agains 3.2r2 SDK, but share-cas does not compile.
It faults with serveral errors for the imports of Classes from org.alfresco.web.site.*:
[javac] C:javaalfresco_3.2r2_casshare-cassrcjavacomatolcdalfrescoCasAuthenticationFilter.java:43: package org.alfresco.web.site does not exist
Did you ever compile your share-cas package against that version of Alfresco-SDK?
Can you provide assitance for this problem?
thanks in advance,
Jan
4 janvier 2010 at 9 h 44 min
Have you try to add : alfresco-web-framework-3.2r2.jar (you can find it into Share lib directory ) into /lib/server/ directory of your 3.2r2 SDK ?
10 mars 2011 at 8 h 58 min
Hi,
I have implemented your solutions in Alfresco 3.4 Enterprise.(with changes described here: http://akselsarchitecture.blogspot.com) It works fine except one case – log out from Share. When a user want to log out from Share a method autenticate from CasAlfrescoAuthenticator class is called. It causes that the logout action has no affect. Alfresco is authenticated in CAS so it returns a ticket to Share and the user is again logged on. In the Alfresco Explorer log out action works correctly because the file relogin.jsp is adapted to the cooperation with CAS. Did you have such a problem? Have you fixed it?
Best Regards,
Pawel Rzeszowski.
17 mars 2011 at 13 h 14 min
Hi Pawel Rzeszowski,
I am also integrating CAS sso with Alfresco share 3.4.c.
Can you please post your configurations for alfresco and share?
Best Regards,
Hemang
21 mars 2011 at 15 h 54 min
Hi Hemang,
I have used settings which can be found herehttp://akselsarchitecture.blogspot.com. A colleague of mine has also managed the problem with Share logout from CAS. He has created a logout controller for CAS which extends AbstractController. This controller is used instead of SlingshotLogoutController. The new controller calls the CAS logout url after the deletion of the Share session.
Best Regards,
Pawel Rzeszowski.
23 mars 2011 at 5 h 32 min
Hi Pawel Rzeszowski,
First of all thanks for your reply!
I have implemented the solution provided on http://akselsarchitecture.blogspot.com. But i am facing some issues.
It would be great if you can share your settings for Alfresco share 3.4.c. So it will help me to identify, Which configuration i am missing for Alfresco share 3.4.c.
Waiting for your reply.
Best Regards,
Hemang
25 mars 2011 at 14 h 44 min
Hi Hemang,
The only thing that I have changed was the host name. What kind of problems do you have? If you describe them maybe I will be able to help you.
Best Regards,
Pawel Rzeszowski.
28 mars 2011 at 6 h 54 min
Hi Pawel Rzeszowski,
Thanks for reply…
Please look into my below configuration and exception:
My Alfresco is running on http://localhost:8081
My CAS tomcat is on other tomcat and is running on http://localhost:8083, and SSL is https://localhost:8446.
Alfresco is running properly but i am facing issue with Alfresco share.
Following is my Alfrescotomcatwebaapsshareweb.xml:
——————————————————
Alfresco Project Slingshot
Alfresco Project Slingshot application
org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
true
Spring config file location
contextConfigLocation
/WEB-INF/classes/web-application-config.xml
CAS Authentication Filter
org.jasig.cas.client.authentication.AuthenticationFilter
casServerLoginUrl
https://hemangj:8446/cas-web/login
serverName
http://hemangj:8081
CAS Validation Filter
org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter
casServerUrlPrefix
https://hemangj:8446/cas-web
serverName
http://hemangj:8081
allowAnyProxy
true
proxyCallbackUrl
http://hemangj:8081/share/proxyCallback
proxyReceptorUrl
/proxyCallback
Alfresco CAS Authentication Filter
com.adplanner.cas.CasAuthenticationFilter
Set HTTP cache Expires header 30 days forward for a mapping.
CacheExpiresFilter
org.alfresco.web.scripts.servlet.StaticAssetCacheFilter
Add an Expires Header 30 days forward
expires
30
MT authentication support – NOTE: does not support portlets
MTAuthentationFilter
org.alfresco.web.site.servlet.MTAuthenticationFilter
Redirects view and service URLs to the dispatcher servlet.
UrlRewriteFilter
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
Share SSO authentication support filter.
Authentication Filter
org.alfresco.web.site.servlet.SSOAuthenticationFilter
endpoint
alfresco
CAS Validation Filter
/*
CAS Authentication Filter
/*
Alfresco CAS Authentication Filter
/*
Authentication Filter
/page/*
Authentication Filter
/p/*
Authentication Filter
/proxy/*
UrlRewriteFilter
/proxy/*
UrlRewriteFilter
/service/*
UrlRewriteFilter
/feedservice/*
UrlRewriteFilter
/res/*
UrlRewriteFilter
/system/*
CacheExpiresFilter
*.jpg
CacheExpiresFilter
*.png
CacheExpiresFilter
*.gif
CacheExpiresFilter
*.css
CacheExpiresFilter
*.js
MTAuthentationFilter
/page/*
MTAuthentationFilter
/p/*
org.springframework.web.context.ContextLoaderListener
Spring Surf Dispatcher Servlet
org.springframework.web.servlet.DispatcherServlet
contextAttribute
org.springframework.web.context.WebApplicationContext.ROOT
1
Spring Surf Dispatcher Servlet
/page/*
Spring Surf Dispatcher Servlet
/p/*
60
index.jsp
index.html
==============================================================
Following is my Alfrescotomcatsharedclassesalfrescoweb-extensionshare-config-custom.xml:
————–
http
Simple Http Connector
Simple HTTP Connector
org.springframework.extensions.webscripts.connector.HttpConnector
alfresco
Alfresco Connector
Connects to an Alfresco instance using ticket-based authentication
org.springframework.extensions.webscripts.connector.AlfrescoConnector
alfresco-ticket
alfresco-ticket
Alfresco Authenticator
Alfresco Authenticator
com.adplanner.cas.CasAlfrescoAuthenticator
alfresco-noauth
Alfresco – unauthenticated access
Access to Alfresco Repository WebScripts that do not require authentication
alfresco
http://localhost:8081/alfresco/s
none
alfresco
Alfresco – user access
Access to Alfresco Repository WebScripts that require user authentication
alfresco
http://localhost:8081/alfresco/s
user
true
alfresco-feed
Alfresco Feed
Alfresco Feed – supports basic HTTP authentication via the EndPointProxyServlet
http
http://localhost:8081/alfresco/s
true
user
==============================================================
When i type url http://localhost:8081/share, it will redirected tom me on CAS login page and after providing username/password and click on Login it give me following exception.
==============================================================
Following is my CAS tomcat log:
——————————
2011-03-28 11:16:14,480 DEBUG [org.springframework.webflow.execution.repository.impl.DefaultFlowExec
utionRepository] –
2011-03-28 11:16:14,489 DEBUG [org.springframework.webflow.conversation.impl.SessionBindingConversat
ionManager] –
2011-03-28 11:16:14,495 DEBUG [org.springframework.webflow.conversation.impl.SessionBindingConversat
ionManager] –
2011-03-28 11:16:14,499 DEBUG [org.springframework.webflow.mvc.servlet.FlowHandlerAdapter] –
2011-03-28 11:16:14,504 DEBUG [org.springframework.web.servlet.DispatcherServlet] –
2011-03-28 11:16:14,514 DEBUG [org.springframework.web.servlet.DispatcherServlet] –
2011-03-28 11:16:19,925 DEBUG [org.springframework.web.servlet.DispatcherServlet] –
2011-03-28 11:16:19,925 DEBUG [org.springframework.webflow.mvc.servlet.FlowHandlerMapping] –
2011-03-28 11:16:19,933 DEBUG [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] –
2011-03-28 11:16:19,940 DEBUG [org.springframework.web.servlet.DispatcherServlet] –
2011-03-28 11:16:19,948 DEBUG [org.jasig.cas.web.support.CasArgumentExtractor] –
2011-03-28 11:16:19,956 DEBUG [org.jasig.cas.authentication.handler.support.HttpBasedServiceCredenti
alsAuthenticationHandler] –
2011-03-28 11:16:19,956 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] –
2011-03-28 11:16:19,964 ERROR [org.jasig.cas.web.ServiceValidateController] –
org.jasig.cas.ticket.TicketCreationException: error.authentication.credentials.bad
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket_aroundBody6(C
entralAuthenticationServiceImpl.java:300)
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket_aroundBody7$a
dvice(CentralAuthenticationServiceImpl.java:44)
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket(CentralAuthen
ticationServiceImpl.java:1)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309
)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocat
ionProceedingJoinPoint.java:80)
at org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:71)
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.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(Abs
tractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJA
dvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:161)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationIn
terceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy14.delegateTicketGrantingTicket(Unknown Source)
at org.jasig.cas.web.ServiceValidateController.handleRequestInternal(ServiceValidateControll
er.java:127)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.j
ava:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControlle
rHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644
)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.ja
va:115)
at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherSer
vlet.java:44)
at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocal
Filter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncoding
Filter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76
)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy
.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:
167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
va:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: error.authentication.credentials.bad
at org.jasig.cas.authentication.handler.BadCredentialsAuthenticationException.(BadCr
edentialsAuthenticationException.java:25)
at org.jasig.cas.authentication.AuthenticationManagerImpl.authenticateAndObtainPrincipal(Aut
henticationManagerImpl.java:103)
at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate_aroundBody0(Abstr
actAuthenticationManager.java:42)
at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate_aroundBody1$advic
e(AbstractAuthenticationManager.java:44)
at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate(AbstractAuthentic
ationManager.java:1)
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket_aroundBody6(C
entralAuthenticationServiceImpl.java:272)
… 56 more
2011-03-28 11:16:20,184 DEBUG [org.jasig.cas.ticket.registry.DefaultTicketRegistry] –
2011-03-28 11:16:20,189 DEBUG [org.jasig.cas.ticket.registry.DefaultTicketRegistry] –
2011-03-28 11:16:20,900 DEBUG [org.jasig.cas.ticket.registry.DefaultTicketRegistry] –
2011-03-28 11:16:20,993 DEBUG [org.springframework.validation.DataBinder] –
2011-03-28 11:16:21,024 DEBUG [org.jasig.cas.web.ServiceValidateController] –
2011-03-28 11:16:21,028 DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory]
–
2011-03-28 11:16:21,034 DEBUG [org.springframework.web.servlet.DispatcherServlet] –
==============================================================
Following is my Alfresco log:
—————————
java.lang.NullPointerException
at org.springframework.extensions.surf.util.URLEncoder.encode(URLEncoder.java:100)
at org.springframework.extensions.surf.util.URLEncoder.encode(URLEncoder.java:172)
at com.adplanner.cas.CasAlfrescoAuthenticator.authenticate(CasAlfrescoAuthenticator.java:79)
at org.springframework.extensions.webscripts.connector.AuthenticatingConnector.handshake(AuthenticatingConnector.java:403)
at org.springframework.extensions.webscripts.connector.AuthenticatingConnector.call(AuthenticatingConnector.java:154)
at org.alfresco.web.site.servlet.SSOAuthenticationFilter.challengeOrPassThrough(SSOAuthenticationFilter.java:556)
at org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:378)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.adplanner.cas.CasAuthenticationFilter.doFilter(CasAuthenticationFilter.java:143)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:94)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:619)
=============================================================
Please provide your input to resolve this issue.
Best Regards,
Hemang
29 mars 2011 at 12 h 32 min
Hi Hemang,
Have you changed web-application-config.xml file? I think you it isn’t needed.
BR,
Pawel Rzeszowski.
29 mars 2011 at 12 h 37 min
Hi Hemang,
This is my configuration in web.xml from share:
CAS Authentication Filter
org.jasig.cas.client.authentication.AuthenticationFilter
casServerLoginUrl
https://przeszowski-2:8443/cas-server-webapp-3.4.6/login
serverName
http://przeszowski-2:8280
CAS Validation Filter
org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter
casServerUrlPrefix
https://przeszowski-2:8443/cas-server-webapp-3.4.6
serverName
http://przeszowski-2:8280
allowAnyProxy
true
proxyCallbackUrl
https://przeszowski-2:8643/share/proxyCallback
proxyReceptorUrl
/proxyCallback
Alfresco CAS Authentication Filter
com.atolcd.alfresco.CasAuthenticationFilter
CAS Validation Filter
/*
CAS Authentication Filter
/*
Alfresco CAS Authentication Filter
/*
30 mars 2011 at 4 h 07 min
Hi Pawel Rzeszowski,
Thanks for reply.
Can you please explain about proxyCallbackUrl & proxyReceptorUrl?
My Alfresco is running on http://localhost:8081
My CAS tomcat is on other tomcat and is running on http://localhost:8083,
and SSL is https://localhost:8446.
I have specify following url in proxyCallbackUrl in share’s web.xml
http://hemangj:8081/share/proxyCallback
And because of this url i am getting exception.
So kindly let me know which url i need to specify in proxyCallbackUrl.
Best Regards,
Hemang
30 mars 2011 at 14 h 06 min
Hi Hemang,
I have the tomcat with cas configured to use ssl on port 8443 and the tomcat with Share on port 8643. So in the web.xml located in the Share’s web.xml I have
this configuration:
proxyCallbackUrl
https://przeszowski-2:8643/share/proxyCallback
Best Regards,
Pawel Rzeszowski.
31 mars 2011 at 5 h 10 min
Hi Pawel Rzeszowski,
I am using Alfresco 3.4.c.
Which version are you using for Alfresco?
===============================================================
I have specify following url in proxyCallbackUrl in share’s web.xml
http://hemangj:8081/share/proxyCallback
And because of this url i am getting exception.
org.jasig.cas.ticket.TicketCreationException: error.authentication.credentials.bad
===============================================================
Please look below full stack trace.
===============================================================
2011-03-31 09:36:09,045 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] –
2011-03-31 09:36:09,073 ERROR [org.jasig.cas.web.ServiceValidateController] –
org.jasig.cas.ticket.TicketCreationException: error.authentication.credentials.bad
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket_aroundBody6(C
entralAuthenticationServiceImpl.java:300)
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket_aroundBody7$a
dvice(CentralAuthenticationServiceImpl.java:44)
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket(CentralAuthen
ticationServiceImpl.java:1)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309
)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMe
thodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocat
ionProceedingJoinPoint.java:80)
at org.perf4j.aop.AbstractTimingAspect.doPerfLogging(AbstractTimingAspect.java:71)
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.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(Abs
tractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJA
dvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:161)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationIn
terceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvo
cation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy14.delegateTicketGrantingTicket(Unknown Source)
at org.jasig.cas.web.ServiceValidateController.handleRequestInternal(ServiceValidateControll
er.java:127)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.j
ava:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControlle
rHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644
)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.ja
va:115)
at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherSer
vlet.java:44)
at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocal
Filter.java:46)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncoding
Filter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76
)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy
.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:
167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j
ava:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.ja
va:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:619)
Caused by: error.authentication.credentials.bad
at org.jasig.cas.authentication.handler.BadCredentialsAuthenticationException.(BadCr
edentialsAuthenticationException.java:25)
at org.jasig.cas.authentication.AuthenticationManagerImpl.authenticateAndObtainPrincipal(Aut
henticationManagerImpl.java:103)
at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate_aroundBody0(Abstr
actAuthenticationManager.java:42)
at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate_aroundBody1$advic
e(AbstractAuthenticationManager.java:44)
at org.jasig.cas.authentication.AbstractAuthenticationManager.authenticate(AbstractAuthentic
ationManager.java:1)
at org.jasig.cas.CentralAuthenticationServiceImpl.delegateTicketGrantingTicket_aroundBody6(C
entralAuthenticationServiceImpl.java:272)
… 56 more
2011-03-31 09:36:09,400 DEBUG [org.jasig.cas.ticket.registry.DefaultTicketRegistry] –
===============================================================
Please help me in this issue.
Best Regards,
Hemang
31 mars 2011 at 6 h 55 min
Hi Hi Pawel Rzeszowski,
Sorry error details was missing above post…
Please look below exception details…
==================================================
2011-03-31 09:36:09,039 DEBUG [org.jasig.cas.authentication.handler.support.HttpBasedServiceCredenti
alsAuthenticationHandler] – Authentication failed because url was not secure.
2011-03-31 09:36:09,045 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] – Authenticat
ionHandler: org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHa
ndler failed to authenticate the user which provided the following credentials: [callbackUrl: http:/
/hemangj:8081/share/proxyCallback]
2011-03-31 09:36:09,073 ERROR [org.jasig.cas.web.ServiceValidateController] – TicketException gener
ating ticket for: [callbackUrl: http://hemangj:8081/share/proxyCallback%5D
=============================================
Best Regards,
Hemang
31 mars 2011 at 12 h 15 min
Hi Hemang,
I think that your error can be caused by the following reason:
In Alfresco or/and Share configuration you have url of cas without https. Please check it and let me know if it was the cause of the problem.
BR
Pawel Rzeszowski.
31 mars 2011 at 13 h 37 min
Hi Pawel Rzeszowski,
I have configured url of cas with https.
Is your Share is deployed on separate tomcat?
Because my alfresco & share is running on same tomcat.
In your share’s web.xml you have specified below url in proxyCallbackUrl:
https://przeszowski-2:8643/share/proxyCallback
And in my share’s web.xml i have specified below url in proxyCallbackUrl:
http://hemangj:8081/share/proxyCallback
You have configured https url and i have configured http url.
So kindly let me know what is the difference.
Best Regards,
Hemang
1 avril 2011 at 12 h 28 min
Hi Hemang,
Yes , my Share is deployed on the separate tomcat. I think that you should change http://hemangj:8081/share/proxyCallback on https://hemangj:/share/proxyCallback to solve the problem Authentication failed Was Not Because secure url.
BR,
Pawel Rzeszowski.
4 avril 2011 at 8 h 08 min
Hi Pawel Rzeszowski,
Thanks for reply.
Can you please tell me how to configure https in Alfresco tomcat?
I know that to enable https, In server.xml we need to change but for Alfresco tomcat how to do that because my share is not deployed on separate tomcat? I have tried but i am not getting success?
Best Regards,
Hemang
7 avril 2011 at 15 h 03 min
I’ve hit an issue that I can’t seem to figure out. I’ve been primarily working off of two forums that seem to have a working solution to the CAS/Explorer/Share single sign on requirements. It is apparent that a large percent of the alfresco community have issues integrating the three together, and is hard to find valid data for releases of alfresco above 3.3.
The meat of the concept that has proven to work for people to get CAS integrated is located in this forum/blog.
This proves to be successful for many people; however, Alfresco has since changed locations of many files and classes since 3.2, so it no longer works.
The link located here: http://akselsarchitecture.blogspot.com/2010/09/cas-sso-for-alfresco-33-and-share.html works in combination with this forum/blog to get their alfresco/share/CAS working for the 3.3 version of alfresco. This blog includes updated java files for the first link’s java files where changes have been made between version 3.2 and 3.3.
I’ve compiled the new java files into jar files and modified my code in combination with both the first link and the second link as instructed by the second link.
Alfresco Explorer is working properly, and the single sign on appears to be working properly as well.
-When you log into Alfresco Share it redirects you to an error screen, but you can go to alfresco explorer and it sees that you are already logged in.
-When you log into Alfresco Explorer, you can go to alfresco share and it sees that you are already logged in (Error screen… but doesn’t prompt for CAS login anymore).
The issue is that upon logging into Share, or navigating to share after logging into Explorer.. I receive errors (see below)
There is no guarantee that this 3.3 alfresco code works for alfresco 3.4.d, but I suspect that it does seeing as all of the interactions appear to be working. I believe there is a simple statement somewhere along the line that the username is not being passed.
Anyone’s thoughts would be appreciated. See errors below.
Tomcat log errors.
SEVERE: Servlet.service() for servlet Spring Surf Dispatcher Servlet threw exception
org.springframework.extensions.surf.exception.UserFactoryException: Unable to create user – failed to retrieve user metadata:
at org.springframework.extensions.surf.support.AlfrescoUserFactory.loadUser(AlfrescoUserFactory.java:177)
at org.springframework.extensions.surf.support.AbstractUserFactory.initialiseUser(AbstractUserFactory.java:176)
at org.springframework.extensions.surf.support.AbstractUserFactory.initialiseUser(AbstractUserFactory.java:99)
at org.springframework.extensions.surf.RequestContextUtil.initialiseUser(RequestContextUtil.java:203)
at org.springframework.extensions.surf.RequestContextUtil.initRequestContext(RequestContextUtil.java:107)
at org.springframework.extensions.surf.RequestContextUtil.initRequestContext(RequestContextUtil.java:54)
at org.alfresco.web.site.SlingshotPageViewResolver.lookupPage(SlingshotPageViewResolver.java:57)
at org.springframework.extensions.surf.mvc.PageViewResolver.canHandle(PageViewResolver.java:103)
at org.springframework.web.servlet.view.UrlBasedViewResolver.createView(UrlBasedViewResolver.java:370)
at org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:77)
at org.springframework.web.servlet.DispatcherServlet.resolveViewName(DispatcherServlet.java:1091)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
………..
On – screen error:
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.extensions.surf.exception.PlatformRuntimeException: 03070000 Failed to init Request Context: Unable to fault user as safeguard during init request context
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)
no.ren.alfresco.CasAuthenticationFilter.doFilter(CasAuthenticationFilter.java:119)
org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:93)
org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)
root cause
org.springframework.extensions.surf.exception.PlatformRuntimeException: 03070000 Failed to init Request Context: Unable to fault user as safeguard during init request context
org.alfresco.web.site.SlingshotPageViewResolver.lookupPage(SlingshotPageViewResolver.java:61)
org.springframework.extensions.surf.mvc.PageViewResolver.canHandle(PageViewResolver.java:103)
……
23 novembre 2011 at 5 h 57 min
Hi, I have a problem. I use Alfresco Community 4.0. The SSO in Share ends with and error « A server error has occured ». I have the next log:
18:33:33,335 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] endpoint: http://alfrescoserver:8090/alfresco/s
18:33:33,335 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] credentials: null
18:33:33,469 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] endpoint: http://alfrescoserver:8090/alfresco/s
18:33:33,469 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] credentials: null
18:33:33,477 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] endpoint: http://alfrescoserver:8090/alfresco/s
18:33:33,477 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] credentials: {cleartextUsername=admin, cleartextPassword=null}
18:33:33,478 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] Authenticating user: admin
18:33:33,485 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] endpoint: http://alfrescoserver:8090/alfresco/s
18:33:33,485 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] credentials: {cleartextUsername=admin, cleartextPassword=null}
18:33:33,485 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] Authenticating user: admin
18:33:33,519 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] endpoint: http://alfrescoserver:8090/alfresco/s
18:33:33,519 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] credentials: null
18:33:33,591 INFO [org.alfresco.web.site.EditionInterceptor] Successfully retrieved license information from Alfresco.
18:33:33,610 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] endpoint: http://alfrescoserver:8090/alfresco/s
18:33:33,610 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] credentials: {cleartextUsername=admin, cleartextPassword=null}
18:33:33,610 ERROR [org.springframework.extensions.webscripts.connector.AlfrescoAuthenticator] Authenticating user: admin
18:33:33,706 ERROR [org.alfresco.web.site] javax.servlet.ServletException: Could not resolve view with name ‘site-index’ in servlet with name ‘Spring Surf Dispatcher Servlet’
Any idea? Whats wrong?
The endpoint url looks weird. Is the URL correct?
23 novembre 2011 at 19 h 33 min
I think the problem is with the webscript, Class « LoginCas » is not executed. Why?? How can I solve that?
24 novembre 2011 at 1 h 23 min
Other error is when I tried to execute logincas webscript:
18:04:54,552 ERROR [freemarker.runtime] Template processing error: « Expression ticket is undefined on line 2, column 11 in api/logincas.get.xml.ftl. »
Expression ticket is undefined on line 2, column 11 in api/logincas.get.xml.ftl.
The problematic instruction:
———-
==> ${ticket} [on line 2, column 9 in api/logincas.get.xml.ftl]
———-
Java backtrace for programmers:
———-
freemarker.core.InvalidReferenceException: Expression ticket is undefined on line 2, column 11 in api/logincas.get.xml.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
My file ‘logincas.get.xml.ftl’ :
<?xml version= »1.0″ encoding= »UTF-8″?>
<ticket>${ticket}</ticket>
29 décembre 2011 at 13 h 17 min
Hello CESAR,
I am also getting the same exception
8:04:54,552 ERROR [freemarker.runtime] Template processing error: « Expression ticket is undefined on line 2, column 11 in api/logincas.get.xml.ftl.
Please let me know if you found the resolution.
Thanks
Nikesh