Thank you! I will look at those links. Got basic functionality working 
without questions to gain understanding of the code. LDAP worked great for 
the password reset portion (again, no questions). When working through the 
details of the JDBC component, I have modest MySQL database for testing:

create table questions (

username tinytext not null,

question tinytext not null,

answer tinytext not null

);


create table pwreset (

username tinytext not null,

password tinytext not null

);


create table email (

username tinytext not null,

email tinytext not null

);

Related JDBC queries:

cas.authn.pm.jdbc.sqlSecurityQuestions=SELECT question, answer FROM 
questions WHERE username=?

cas.authn.pm.jdbc.sqlFindEmail=SELECT email FROM email WHERE username=?

cas.authn.pm.jdbc.sqlChangePassword=insert into pwreset (password, 
username) values (?, ?)

Populated user with two emails  - CAS does not like, but I am planning on 
extending this. We have users with multiple personal email as option.

Working around that, I have three questions setup for user, and I know that 
Map is being used:

Caused by: org.springframework.dao.IncorrectResultSizeDataAccessException: 
Incorrect result size: expected 1, actual 3

        at 
org.springframework.dao.support.DataAccessUtils.requiredSingleResult(DataAccessUtils.java:74)
 
~[spring-tx-4.3.8.RELEASE.jar:4.3.8.RELEASE]

        at 
org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:795)
 
~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]

        at 
org.springframework.jdbc.core.JdbcTemplate.queryForMap(JdbcTemplate.java:828) 
~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]

        at 
org.apereo.cas.pm.jdbc.JdbcPasswordManagementService.getSecurityQuestions(JdbcPasswordManagementService.java:68)
 
~[cas-server-support-pm-5.1.1.jar:5.1.1]

Line 68 is definitely the overridden getSecurityQuestions() with the Map, 
but question results are limited to 1? Cannot find this result size in the 
code.

Don't think I am missing a config option...


Bill


On Thursday, July 6, 2017 at 4:06:18 PM UTC-4, Misagh Moayyed wrote:
>
> Great.
>
> What you want to do is mostly controlled by this line:
>
>
> https://github.com/apereo/cas/blob/master/support/cas-server-support-pm/src/main/java/org/apereo/cas/pm/config/PasswordManagementConfiguration.java#L125
>
> Write something that extends/implements PasswordManagementService. Then 
> inject a “bean” instance of it into the runtime engine. CAS will pick up 
> yours instead of the defaults (note that Conditional tag).
>
> To learn how to inject config into CAS dynamically:
>
> https://apereo.github.io/cas/5.1.x/installation/Configuration-Management-Extensions.html
>
> More or less the same:
> https://apereo.github.io/2017/02/21/cas-autocfg-strategy/ 
>
> --Misagh
>
> On July 6, 2017 at 12:48:06 PM, William Jojo ([email protected] 
> <javascript:>) wrote:
>
> Thank you, Misagh. I am looking at the code tree at 
> https://github.com/apereo/cas/blob/master/support/cas-server-support-pm/src/main/java/org/apereo/cas/pm/.
>  
> Again, at the moment, I am attempting to trigger the basic PM 
> functionality, then I can determine the injection point. If may attempt is 
> worthy, I am happy to contribute it to CAS.
>
> Bill
>
>

-- 
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
--- 
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/a500a35c-0ae0-4629-a048-06d0b3a652d6%40apereo.org.

Reply via email to