Apereo CAS 5.3-自定义接受身份验证

时间:2018-11-16 09:13:37

标签: java spring cas

我正在使用cas-overlay-template版本5.3(https://github.com/apereo/cas-overlay-template/tree/5.3

我要自定义authenticationHandler,

@Configuration("AcceptAuthenticationConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class AcceptAuthenticationConfiguration
        implements AuthenticationEventExecutionPlanConfigurer {

    private static final org.slf4j.Logger LOGGER = LoggerFactory.getLogger(AcceptAuthenticationConfiguration.class);

    @Autowired
    private CasConfigurationProperties casProperties;

这是我显示casProperies的值的方式:

@RefreshScope
@Bean
public AuthenticationHandler myAuthenticationHandler() {
        LOGGER.debug("Location = ", casProperties.getServiceRegistry().getJson().getLocation());

        final CustomAuthenticationHandler handler = new CustomAuthenticationHandler("abc", servicesManager, myAuthenticationPrincipalFactory(), 0);
        return handler;
}

这里有个问题:变量 casProperties 不会被 cas.properties 文件中的值所覆盖。

我该怎么办?

Github源代码:git: https://github.com/vnpt2324/cas-overlay-template/blob/master/src/main/java/authentication/AcceptAuthenticationConfiguration.java

0 个答案:

没有答案