yes, I'm trying to see how things are organized in the cas src support jdbc.
But I'm stuck in how to manage having special JDBC properties related to
the customized handler in the *cas.properties* file, and then what are the
related classes to be added and modified according to that?
In my trail I'd created the following hierarchy:
src/
└── main
├── java
│ └── org
│ └── custom
│ └── cas
│ └── adaptors
│ └── jdbc
│ ├── config
│ │ └──
CustomAuthenticationEventExecutionPlanConfiguration.java
│ └── CustomQueryDatabaseAuthenticationHandler.java
│
└── resources
└── META-INF
└── spring.factories
Here is the *CustomAuthenticationEventExecutionPlanConfiguration.java*
class:
package org.custom.cas.adaptors.jdbc.config;
import org.custom.cas.adaptors.jdbc.CustomQueryDatabaseAuthenticationHandler
;
.
.
@Configuration("CustomAuthenticationEventExecutionPlanConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class CustomAuthenticationEventExecutionPlanConfiguration
implements AuthenticationEventExecutionPlanConfigurer {
private static final Logger LOGGER = LoggerFactory.getLogger(
CustomAuthenticationEventExecutionPlanConfiguration.class);
@Autowired
private CasConfigurationProperties casProperties;
@Autowired(required = false)
@Qualifier("customQueryPasswordPolicyConfiguration")
private PasswordPolicyConfiguration
customQueryPasswordPolicyConfiguration;
@Autowired
@Qualifier("servicesManager")
private ServicesManager servicesManager;
@Bean
public AuthenticationHandler customQueryDatabaseAuthenticationHandler()
{
final JdbcAuthenticationProperties.Query b;
final Map<String, String> attributes = Beans.
transformPrincipalAttributesListIntoMap(b.getPrincipalAttributeList());
LOGGER.debug("Created and mapped principal attributes [{}] for
[{}]...", attributes, b.getUrl());
final CustomQueryDatabaseAuthenticationHandler h = new
CustomQueryDatabaseAuthenticationHandler(b.getName(), servicesManager,
jdbcPrincipalFactory(), b.getOrder(),
Beans.newDataSource(b), b.getSql(), b.getFieldPassword(),
b.getFieldExpired(), b.getFieldDisabled(), attributes);
...
...
return h;
}
@ConditionalOnMissingBean(name = "jdbcPrincipalFactory")
@Bean
@RefreshScope
public PrincipalFactory jdbcPrincipalFactory() {
return new DefaultPrincipalFactory();
}
@Override
public void configureAuthenticationExecutionPlan(final
AuthenticationEventExecutionPlan plan) {
plan.registerAuthenticationHandler(
customQueryDatabaseAuthenticationHandler());
}
}
The code above is mostly copied from the
*org.apereo.cas.adaptors.jdbc.config.CasJdbcAuthenticationConfiguration.java
v 5.1.x*
BUT again how should I handle the:
final JdbcAuthenticationProperties.Query b
relatively in my case??!!
Regards,
On Thursday, December 7, 2017 at 4:58:19 AM UTC+2, Manfredo Hopp wrote:
>
> Hi,
>
> I dont have my source at hand at this momemt but it helped looking into
> cas src support jdbc.
>
> Regards
>
> El miércoles, 6 de diciembre de 2017, noumann.f <[email protected]
> <javascript:>> escribió:
>
>> Hi,
>>
>> I need to create a custom JDBC authentication handler, I'd done this
>> previously with version 4.x but with new version 5.1.x things have changed
>> !!
>>
>> I'm following the guide in here:
>> https://apereo.github.io/2017/02/02/cas51-authn-handlers
>> but I need more details about registering the new handler and how to
>> create special properties for it in the cas.properties and then reach them
>> in the code!
>>
>> Best regards,
>>
>> --
>> - 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] <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/4b50d3ab-aef7-4424-87a1-b879d10375a7%40apereo.org
>>
>> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/4b50d3ab-aef7-4424-87a1-b879d10375a7%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/8a0b7e04-b40f-4508-a5a8-06319bf9d7d6%40apereo.org.