cancel
Showing results for 
Search instead for 
Did you mean: 

Authentication Chain CAS + Local User

togum
Champ in-the-making
Champ in-the-making
I've configured so that my Alfresco can integrated with CAS Jasig.
I'm successfull login via CAS redirect to alfresco page.

Fyi: CAS configured connect to Active Directory

This is my alfresco-global.properties CAS configuration:

#CAS
authentication.chain=cas:external,ldap1:ldap

But now, I want local users can be successfull login via CAS. Is it impossible with CAS?
So user of Active Directory and local user of Alfresco can be successfull login via CAS.

Thanks in advanced.
6 REPLIES 6

andrepra
Champ in-the-making
Champ in-the-making
Since your authentication process is performed by CAS you need to change your Authentication Handler to check the user first on ActiveDirectory and after on Alfresco repository (ie: via web services or rest API)

togum
Champ in-the-making
Champ in-the-making
Thank you andrepra

Can you advise me to change my Authentication Handler?
I'm sorry, I really don't understand about it yet.

luca
Star Contributor
Star Contributor
Hi togumm,
did you integrate CAS with Alfresco 3.2 or a newer version?

I'm tryng to use CAS with Alfresco 4, but I have some problems, can you help me?
I already did it with Alfresco 3.2, but I can't with Alfresco 4…

andrepra
Champ in-the-making
Champ in-the-making
Since 3.2 change the authentication architecture. You have to understand how authentication subsystem works and configure a chain that perform the authetication process.
I did the integration also with 3.4 and 4 but I built my own authentication subsystem, I'm not using the "external"

luca
Star Contributor
Star Contributor
Hi andrepra,
in my configuration now I succefully authenticate the user in CAS, the I return in my filter class in Alfresco, but I can't authenticate the user in Alfresco.

I tried in some ways, but none worked…  :x  (https://forums.alfresco.com/en/viewtopic.php?f=57&t=45399).

Could you tell me how did you authenticate the user in Alfresco?

I tried something like that:
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
   public Void doWork() throws Exception {
      WebApplicationContext wc = WebApplicationContextUtils.getRequiredWebApplicationContext(contextF);
      AuthenticationContext authenticationContext = (AuthenticationContext)authentication;
      
      GrantedAuthority[] gas = new GrantedAuthority[1];
        gas[0] = new GrantedAuthorityImpl("ROLE_AUTHENTICATED");
        UserDetails ud = new net.sf.acegisecurity.providers.dao.User(userName, "", true, true, true, true, gas);
      
      authenticationContext.setUserDetails(ud);
   }
}
I reconstructed it from my various test, so there may be some errors…

togum
Champ in-the-making
Champ in-the-making
Hi andrepra, thanks for your help. It's work with Alfresco 3.
Luca, I didn't tested with Alfresco 4 yet Smiley Happy