Custom Attribute Resolution

You may also design and inject your own attribute repository and principal resolution implementation into CAS that would itself handle fetching attributes and resolving persons, etc. In order to do this, you will need to design a configuration class that roughly matches the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package org.apereo.cas.custom;

@AutoConfiguration
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class MyConfiguration {

    @Bean
    public PersonAttributeDao myPersonAttributeDao() {
        return new MyPersonAttributeDao(...);
    }

    @Bean
    public PersonDirectoryAttributeRepositoryPlanConfigurer myAttributeRepositoryPlanConfigurer(
        @Qualifier("myPersonAttributeDao")
        final PersonAttributeDao myPersonAttributeDao) {
        return plan -> plan.registerAttributeRepository(myPersonAttributeDao);
    }
}

See this guide to learn more about how to register configurations into the CAS runtime.