you can introduce your own config keys in cas.properties and define your own 
Config bean.

Access the properties with @Value annotation in the config bean like so:
@Configuration(„myCustomApplicationConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@AutoConfigureAfter(CasCoreTicketsConfiguration.class)
public class MyCustomApplicationConfiguration {
  @Value(„${my.custom.property}")
  public String customProp
    ...
}
 

> Am 21.12.2017 um 13:23 schrieb noumann.f <[email protected]>:
> 
> Thanks,
> 
> Yes indeed, it's all about `CasConfigurationProperties` class, but I was 
> wondering if there is any way to do this without needing to override this 
> class in my project.
> 
> Anyway, while my handler is alive without this feature I can postpone this.
> 
> Regards,
> 
> On Wednesday, December 20, 2017 at 8:50:57 PM UTC+2, Manfredo Hopp wrote:
> Hi 
> 
> glad to hear your progress. 
> 
> To load your properties you could have a look on how they are loaded for cas 
> in src org.apereo.cas.configuration.CasConfigurationProperties where all 
> properties are loaded. 
> Important thing is this: 
> 
> @ConfigurationProperties("cas")
> public class CasConfigurationProperties 
> 
> 
> Regards
> 
> 
> 
> 2017-12-20 11:22 GMT-03:00 noumann.f <[email protected] <>>:
> And that's what happened,
> 
> setting up a fresh development env. and following the instructions inhere: 
> https://apereo.github.io/cas/5.1.x/installation/Configuring-Custom-Authentication.html
>  
> <https://apereo.github.io/cas/5.1.x/installation/Configuring-Custom-Authentication.html>
>  enabled me to create a custom handler that accepts users whom username is 
> similar to their password as a simple example.
> 
> Then, imitating the JDBC query authentication handler I could modified my 
> handler to connect and authenticate against a MySql database.
> 
> What is annoying me is that I couldn't create my own custom properties in the 
> `cas.properties` and I'm depending on the `cas.authn.jdbc.query[0].xxx` 
> properties. For the current time, any needed properties are hard-coded in the 
> handler class!!
> Is there any easy way to do this without hacking a lot of source code?!
> 
> Thanks a lot for your help,
> 
> Best regards,
> 
> 
> 
> 
> 
> On Thursday, December 14, 2017 at 3:51:20 PM UTC+2, Manfredo Hopp wrote:
> Ok,
> 
> using this a starting point try to debug your handler.
> 
> 2017-12-14 4:45 GMT-03:00 noumann.f <[email protected] <>>:
> Commenting out only `cas.authn.accept.users=` didn't help, BUT commenting the 
> policy entries either made it work and let me authenticate as (casuser, 
> Mellon).
> 
> On Thursday, December 14, 2017 at 12:47:29 AM UTC+2, Manfredo Hopp wrote:
> Hi
> 
> Can you comment out cas.authn.accept.users= in cas properties and see if at 
> least you can authenticate with casuser?
> 
> 
> 2017-12-13 6:24 GMT-03:00 noumann.f <[email protected] <>>:
> Sorry for being late to respond to you request, but the test machine I was 
> working on broke  down suddenly!
> 
> below the log after authentication:
> 
> log.cas
> 
> 2017-12-13 11:25:17,913 INFO 
> [org.apereo.cas.support.events.listener.DefaultCasEventListener] - <
> 
> 
>   ____    _____      _      ____   __   __
>  |  _ \  | ____|    / \    |  _ \  \ \ / /
>  | |_) | |  _|     / _ \   | | | |  \ V / 
>  |  _ <  | |___   / ___ \  | |_| |   | |  
>  |_| \_\ |_____| /_/   \_\ |____/    |_|  
>                                           
> >
> 2017-12-13 11:25:17,914 INFO 
> [org.apereo.cas.support.events.listener.DefaultCasEventListener] - < [0m>
> 2017-12-13 11:25:17,914 INFO 
> [org.apereo.cas.support.events.listener.DefaultCasEventListener] - <Ready to 
> process requests @ [2017-12-13T09:25:17.909Z]>
> 2017-12-13 11:25:17,915 INFO [org.apereo.cas.web.CasWebApplication] - 
> <Started CasWebApplication in 27.184 seconds (JVM running for 29.605)>
> 2017-12-13 11:25:37,644 DEBUG 
> [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating 
> new transaction with name 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: 
> PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
> 2017-12-13 11:25:37,645 DEBUG 
> [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating 
> new transaction with name 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: 
> PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
> 2017-12-13 11:25:37,649 DEBUG 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Attempting 
> to acquire ticket cleanup lock.>
> 2017-12-13 11:25:37,650 DEBUG 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Acquired 
> lock. Proceeding with cleanup.>
> 2017-12-13 11:25:37,652 DEBUG 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] expired 
> tickets found.>
> 2017-12-13 11:25:37,652 INFO 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] expired 
> tickets removed.>
> 2017-12-13 11:25:37,652 DEBUG 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Releasing 
> ticket cleanup lock.>
> 2017-12-13 11:25:37,652 DEBUG 
> [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Finished 
> ticket cleanup.>
> 2017-12-13 11:25:37,653 DEBUG 
> [org.apereo.cas.services.DefaultServicesManager] - <Loading services from 
> [InMemoryServiceRegistry]>
> 2017-12-13 11:25:37,653 INFO [org.apereo.cas.services.DefaultServicesManager] 
> - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
> 2017-12-13 11:25:37,658 DEBUG 
> [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - 
> <Initiating transaction commit>
> 2017-12-13 11:25:37,658 DEBUG 
> [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Resuming 
> suspended transaction after completion of inner transaction>
> 2017-12-13 11:25:37,659 DEBUG 
> [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - 
> <Initiating transaction commit>
> 2017-12-13 11:25:50,288 INFO [org.apereo.cas.web.flow.InitialFlowSetupAction] 
> - <Setting path for cookies for warn cookie generator to: [/cas/] >
> 2017-12-13 11:25:50,294 DEBUG 
> [org.apereo.cas.authentication.principal.WebApplicationServiceFactory] - <No 
> service is specified in the request. Skipping service creation>
> 2017-12-13 11:25:50,295 DEBUG 
> [org.apereo.cas.web.support.DefaultArgumentExtractor] - <No service could be 
> extracted based on the given request>
> 2017-12-13 11:25:50,295 DEBUG 
> [org.apereo.cas.web.support.AbstractArgumentExtractor] - <Extractor did not 
> generate service.>
> 2017-12-13 11:25:50,319 DEBUG [org.apereo.cas.web.support.WebUtils] - 
> <Evaluating request to determine if warning cookie should be generated>
> 2017-12-13 11:25:50,327 INFO 
> [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit 
> trail record BEGIN
> =============================================================
> WHO: audit:</
> 
> -- 
> - Website: https://apereo.github.io/cas <https://apereo.github.io/cas>
> - Gitter Chatroom: https://gitter.im/apereo/cas <https://gitter.im/apereo/cas>
> - List Guidelines: https://goo.gl/1VRrw7 <https://goo.gl/1VRrw7>
> - Contributions: https://goo.gl/mh7qDG <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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/96a021c4-2dce-4840-a57f-7662024693f0%40apereo.org
>  
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/96a021c4-2dce-4840-a57f-7662024693f0%40apereo.org?utm_medium=email&utm_source=footer>.

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/56A68D83-B246-4917-9274-A1BE860FC5AA%40gmail.com.

Reply via email to