Couldn't build in Linux RHEL

425 views
Skip to first unread message

Amulya Sri Pulijala

unread,
Jan 30, 2024, 2:17:41 PM1/30/24
to CAS Community
Hey,

Am new to Apareo CAS. I could build v 6.6 in windows using gradle . But, when am trying to build it in Linux RHEL, I could not see any error during build, however, the war generated is of 261Kb only.

And I could see that WEB-INF folder itself is missing in war file., the build process is same. I just cloned and ran .\gradlew clean build.
I tried stopping the gradle, cleaning it and restarting, but the output is ssame.

Kindly help me. Thanks in Advance!

Regards,
Amulya

Ray Bon

unread,
Jan 30, 2024, 3:21:45 PM1/30/24
to cas-...@apereo.org
Amulya,

Are you talking about the cas project or cas-overlay-template?

Check your command (mind the '/' not '\'):
./gradlew clean build

Ray

On Tue, 2024-01-30 at 10:22 -0800, Amulya Sri Pulijala wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Maxwell, Gary

unread,
Jan 30, 2024, 4:08:31 PM1/30/24
to cas-...@apereo.org

 

Hello All,

 

The sync script is not executing after clicking “synchronize” button in CAS Management App.

 

The CAS Management config contains the following :

 

mgmt.version-control.enabled=false

mgmt.version-control.sync-script=/opt/test/sync.sh

 

The sync script DOES execute if version control is active

 

mgmt.version-control.enabled=true

 

Any Ideas would be great!

 

-Gary

 

 

 

Maxwell, Gary

unread,
Jan 30, 2024, 11:40:56 PM1/30/24
to cas-...@apereo.org

More troubleshooting information:

 

The Sync script is not executing because we receive a 404 error from the following:

 

GET https://cas-management.edu/cas-management/api/commit/sync

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/DM6PR03MB452342DCB0EE8243ECE69E57957D2%40DM6PR03MB4523.namprd03.prod.outlook.com.

Amulya Sri Pulijala

unread,
Jan 31, 2024, 1:34:19 AM1/31/24
to CAS Community, Maxwell, Gary
Thanks Gary!

I sorted it out!

Amulya Sri Pulijala

unread,
Jan 31, 2024, 1:34:19 AM1/31/24
to CAS Community, Ray Bon
Thanks a ton! This helped. I could build it in RHEL using cas-overlay-template.

I have a doubt that, Can I customize UI and add few widgets like label,  textbox (such as mathematical expressions for captcha) etc in cas-overlay-template as well?? 
And specific functionality for them?

Regards,
Amulya

Ray Bon

unread,
Jan 31, 2024, 9:21:33 AM1/31/24
to amulyasri...@gmail.com, cas-...@apereo.org

Amulya Sri Pulijala

unread,
Feb 2, 2024, 12:52:29 AM2/2/24
to CAS Community, Ray Bon, amulyasri...@gmail.com
Thanks! that helped! I customized loginform.html and wrote my own handler. 
Can someone point out a tutorial of how to build or how to write configuration for the handler?

Amulya

Amulya Sri Pulijala

unread,
Feb 2, 2024, 12:52:29 AM2/2/24
to CAS Community, Ray Bon, amulyasri...@gmail.com
Hey, I tried writing custom login handler. I am getting the following error: 
***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of constructor in com.example.authentication.CustomAuthenticationHandler required a bean of type 'java.lang.String' that could not be found.

I did declare it as bean. declared the same in applications.yml too... what am i missing?

Ray Bon

unread,
Feb 2, 2024, 9:57:11 PM2/2/24
to amulyasri...@gmail.com, cas-...@apereo.org
Amulya,

You can copy what is done for the default login form.
I thought there was some guidance in the docs, but I am unable to find it. You can use spring tutorials.

Ray

Amulya Sri Pulijala

unread,
Feb 3, 2024, 12:18:57 PM2/3/24
to CAS Community, Ray Bon, amulyasri...@gmail.com
Thanks! 

I could create login page; handler and configure as well. 
I added it in both applications.yml and spring.factories as well.

My cas.properties is as follows: 
cas.authn.accept.enabled=false
cas.authn.handler.names=customAuthenticationHandler
cas.authn.customHandlers.customAuthenticationHandler.name=customAuthenticationHandler
cas.authn.customHandlers.customAuthenticationHandler.type=com.example.authentication.CustomAuthenticationHandler
cas.authn.customHandlers.customAuthenticationHandler.url=jdbc:postgresql://localhost:5432/cas
cas.authn.customHandlers.customAuthenticationHandler.username=postgres
cas.authn.customHandlers.customAuthenticationHandler.password=test@123
cas.authn.customHandlers.customAuthenticationHandler.sql=SELECT * FROM users WHERE username = ? AND password = ?
cas.authn.customHandlers.customAuthenticationHandler.order=1


Am facing the issue that login is not going to the custom handler. I could see that respective classes are generated at the correct location also.

Thanks in advance! Kindly share your thoughts/inputs.

Amulya

Amulya Sri Pulijala

unread,
Feb 3, 2024, 7:59:03 PM2/3/24
to CAS Community, Amulya Sri Pulijala, Ray Bon

This is the error log: 
2024-02-04 02:51:39,235 ERROR [org.apereo.cas.configuration.CasConfigurationPropertiesValidator] - <
Failed to bind properties under 'cas' to org.apereo.cas.configuration.CasConfigurationProperties

        cas.authn.authentication-handlers.custom-authentication-handler.class = com.example.authentication.CustomAuthenticationHandler (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.class" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.name = customAuthenticationHandler (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.name" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.order = 1 (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.order" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.password = test@123 (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.password" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.sql = SELECT * FROM users1 WHERE username = ? AND password = ? (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.sql" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.type = com.example.authentication.CustomAuthenticationHandler (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.type" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.url = jdbc:postgresql://localhost:5433/cas (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.url" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.authentication-handlers.custom-authentication-handler.username = postgres (Origin: "cas.authn.authentication-handlers.custom-authentication-handler.username" from property source "bootstrapProperties-casCompositePropertySource")

        cas.authn.handler.names = customAuthenticationHandler (Origin: "cas.authn.handler.names" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.attributes.attributename = attributeValue (Origin: "cas.server.httpProxy.attributes.attributeName" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.enabled = true (Origin: "cas.server.httpProxy.enabled" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.protocol = AJP/1.3 (Origin: "cas.server.httpProxy.protocol" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.proxyport =  (Origin: "cas.server.httpProxy.proxyPort" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.redirectport =  (Origin: "cas.server.httpProxy.redirectPort" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.scheme = https (Origin: "cas.server.httpProxy.scheme" from property source "bootstrapProperties-casCompositePropertySource")

        cas.server.httpproxy.secure = true (Origin: "cas.server.httpProxy.secure" from property source "bootstrapProperties-casCompositePropertySource")

        cas.ticket.pgt.encryptionkey.cache = false (Origin: "cas.ticket.pgt.encryptionKey.cache" from property source "bootstrapProperties-casCompositePropertySource")

        cas.ticket.pt.encryptionkey.cache = false (Origin: "cas.ticket.pt.encryptionKey.cache" from property source "bootstrapProperties-casCompositePropertySource")

        cas.ticket.registry.jpa.isquerycacheenabled = true (Origin: "cas.ticket.registry.jpa.isQueryCacheEnabled" from property source "bootstrapProperties-casCompositePropertySource")

        cas.ticket.registry.jpa.querycacheprovider = org.hibernate.cache.ehcache.EhCacheRegionFactory (Origin: "cas.ticket.registry.jpa.queryCacheProvider" from property source "bootstrapProperties-casCompositePropertySource")

        cas.ticket.st.encryptionkey.cache = false (Origin: "cas.ticket.st.encryptionKey.cache" from property source "bootstrapProperties-casCompositePropertySource")

        cas.ticket.tgt.encryptionkey.cache = false (Origin: "cas.ticket.tgt.encryptionKey.cache" from property source "bootstrapProperties-casCompositePropertySource")

Listed settings above are no longer recognized by CAS 6.6.15. They may have been renamed, removed, or relocated to a new namespace in the CAS configuration schema. CAS will ignore such settings to proceed with its normal initialization sequence. Please consult the CAS documentation to review and adjust each setting to find an alternative or remove the definition from the property source. Failure to do so puts the server stability in danger and complicates future upgrades.
>

Ray Bon

unread,
Feb 5, 2024, 9:31:01 AM2/5/24
to amulyasri...@gmail.com, cas-...@apereo.org
Amulya,

To add 'customHandlers' you would need to modify the class that handles authn properties (cas.authn).
To see how the chain of properties works in cas, start with the main class,

Search this file for 'authn' which is a class member pointing to AuthenticationProperties

I do not suggest modifying AuthenticationProperties.
You can create your own properties file (maybe CustomProperties) which could have a member variable authn pointing to CustomAuthenticationProperties. Given CustomAuthenticationProperties extends AuthenticationProperties, your property would then be

cusom.authn.jdbc.bind[0].password=test@123

i.e. leverage the properties of existing classes.

Authentication can be a complex process.
Cas is very modular. Small parts are assembled to meet the complexity.

Are trying to make a single handler to process; username, password, captcha, ui widgets, etc?
Many cas features have the capability to add groovy scripts. Perhaps some of your custom features can be met with builtin features + groovy.


Ray

Amulya Sri Pulijala

unread,
Feb 5, 2024, 11:30:29 AM2/5/24
to Ray Bon, cas-...@apereo.org
Thanks!

Yeah.. am trying to add captcha, username, password etc in a single handler. Any pointers to such tutorials?

Amulya

Amulya Sri Pulijala

unread,
Feb 5, 2024, 3:19:44 PM2/5/24
to Ray Bon, cas-...@apereo.org
Hey,

Any custom code is also fine, something like mathematical expression etc. I did try with Groovy script but I couldnt compile it, as am getting an error that authenticate method is not implemented., but I did have that in my script. 

Small groovy script which generates an expression and validates at user end is sufficient. Generation can be done at front end which I've already done it.

Kindl y provide me if you have any grovy scripts tutorial or custom handler tutorial..
Amulya

On Tue, Feb 6, 2024 at 1:27 AM Ray Bon <rb...@uvic.ca> wrote:
Amulya,

Are you sure you need to have a custom captcha (or any other custom code)?
If you do create something custom, try to make it in such a way that it can be added to the main cas project (hopefully you will have time to do so - which I seem to lack). 

https://fawnoos.com/blog/ is a good place to start. You will also need to understand various spring libraries.

Take a look at the existing reCaptcha https://apereo.github.io/cas/7.0.x/integration/Configuring-Google-reCAPTCHA.html and how it is implemented, how it fits into [spring] web flow, gets properties etc. You may be able to extend those classes.

Ray

Ray Bon

unread,
Feb 5, 2024, 3:19:50 PM2/5/24
to amulyasri...@gmail.com, cas-...@apereo.org
Amulya,

Are you sure you need to have a custom captcha (or any other custom code)?
If you do create something custom, try to make it in such a way that it can be added to the main cas project (hopefully you will have time to do so - which I seem to lack). 

https://fawnoos.com/blog/ is a good place to start. You will also need to understand various spring libraries.

Take a look at the existing reCaptcha https://apereo.github.io/cas/7.0.x/integration/Configuring-Google-reCAPTCHA.html and how it is implemented, how it fits into [spring] web flow, gets properties etc. You may be able to extend those classes.

Ray

Ray Bon

unread,
Feb 5, 2024, 11:36:17 PM2/5/24
to amulyasri...@gmail.com, cas-...@apereo.org
Amulya,

Depending on where the groovy script is called, it may have different requirements / passed in arguments. These are outlined in the docs.

'method not implemented' sounds like a method signature issue; would need to see the code.

You should create a new thread for this.

Ray

Ray Bon

unread,
Feb 6, 2024, 8:19:20 AM2/6/24
to amulyasri...@gmail.com, cas-...@apereo.org
Start a new thread. People may skip over this because the problem does not match the title.

Ray

On Mon, 2024-02-05 at 22:29 -0800, Amulya Sri Pulijala wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.


Hey,
The following is the error, 2024-02-06 11:31:00,012 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationManager] - <Attempting authentication of [casuser] using [GroovyAuthenticationHandler]>
2024-02-06 11:31:00,012 ERROR [org.apereo.cas.authentication.DefaultAuthenticationManager] - <Authentication has failed. Credentials may be incorrect or CAS cannot find authentication handler that supports [UsernamePasswordCredential(username=casuser, source=null, customFields={})] of type [UsernamePasswordCredential]. Examine the configuration to ensure a method of authentication is defined and analyze CAS logs at DEBUG level to trace the authentication event.>
2024-02-06 11:31:00,015 ERROR [org.apereo.cas.authentication.DefaultAuthenticationManager] - <[GroovyAuthenticationHandler]: [No signature of method: CustomAuthenticationHandler.authenticate() is applicable for argument types: (org.apereo.cas.adaptors.generic.GroovyAuthenticationHandler, org.apereo.cas.authentication.credential.UsernamePasswordCredential...) values: [org.apereo.cas.adaptors.generic.GroovyAuthenticationHandler@b2ba975b, ...]
Possible solutions: authenticate(org.apereo.cas.authentication.Credential, org.apereo.cas.authentication.principal.Service)]>
2024-02-06 11:31:00,015 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan] - <Authentication policy resolvers for this transaction are [[org.apereo.cas.authentication.policy.RegisteredServiceAuthenticationPolicyResolver@129a5c2f]]>

But i do have authenticate method as follows:
AuthenticationHandlerExecutionResult authenticate(Credential credential, Service service) {
        if (credential instanceof UsernamePasswordCredential) {
            def usernamePasswordCredential = (UsernamePasswordCredential) credential
            if (usernamePasswordCredential.username == 'user' && usernamePasswordCredential.password == 'password') {
                def principal = principalFactory.createPrincipal(usernamePasswordCredential.username)
                return new DefaultAuthenticationHandlerExecutionResult(
                        this,
                        new BasicCredentialMetaData(credential),
                        principal,
                        new ArrayList<>(0)
                )
            }
        }
        return null
    }

Amulya
Reply all
Reply to author
Forward
0 new messages