/** * Validates the required properties are set. In addition, if * {@link #setCallbackHandlers(JaasAuthenticationCallbackHandler[])} has not been * called with valid handlers, initializes to use {@link JaasNameCallbackHandler} and * {@link JaasPasswordCallbackHandler}. */ public void afterPropertiesSet() throws Exception { Assert.hasLength(this.loginContextName, "loginContextName cannot be null or empty"); Assert.notEmpty(this.authorityGranters, "authorityGranters cannot be null or empty"); if (ObjectUtils.isEmpty(this.callbackHandlers)) { setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler() }); } Assert.notNull(this.loginExceptionResolver, "loginExceptionResolver cannot be null"); }
/** * Validates the required properties are set. In addition, if * {@link #setCallbackHandlers(JaasAuthenticationCallbackHandler[])} has not been * called with valid handlers, initializes to use {@link JaasNameCallbackHandler} and * {@link JaasPasswordCallbackHandler}. */ public void afterPropertiesSet() throws Exception { Assert.hasLength(this.loginContextName, "loginContextName cannot be null or empty"); Assert.notEmpty(this.authorityGranters, "authorityGranters cannot be null or empty"); if (ObjectUtils.isEmpty(this.callbackHandlers)) { setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler() }); } Assert.notNull(this.loginExceptionResolver, "loginExceptionResolver cannot be null"); }
private void testConfigureJaasCase(JaasAuthenticationProvider p1, JaasAuthenticationProvider p2) throws Exception { p1.setLoginConfig(new ClassPathResource(resolveConfigFile("/test1.conf"))); p1.setLoginContextName("test1"); p1.setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new TestCallbackHandler(), new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler() }); p1.setAuthorityGranters(new AuthorityGranter[] { new TestAuthorityGranter() }); p1.afterPropertiesSet(); testAuthenticate(p1); p2.setLoginConfig(new ClassPathResource(resolveConfigFile("/test2.conf"))); p2.setLoginContextName("test2"); p2.setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new TestCallbackHandler(), new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler() }); p2.setAuthorityGranters(new AuthorityGranter[] { new TestAuthorityGranter() }); p2.afterPropertiesSet(); testAuthenticate(p2); }
/** * Validates the required properties are set. In addition, if * {@link #setCallbackHandlers(JaasAuthenticationCallbackHandler[])} has not * been called with valid handlers, initializes to use * {@link JaasNameCallbackHandler} and {@link JaasPasswordCallbackHandler}. */ public void afterPropertiesSet() throws Exception { Assert.hasLength(loginContextName, "loginContextName cannot be null or empty"); Assert.notEmpty(authorityGranters, "authorityGranters cannot be null or empty"); if (ObjectUtils.isEmpty(callbackHandlers)) { setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler() }); } Assert.notNull(loginExceptionResolver, "loginExceptionResolver cannot be null"); }
/** * Validates the required properties are set. In addition, if * {@link #setCallbackHandlers(JaasAuthenticationCallbackHandler[])} has not been * called with valid handlers, initializes to use {@link JaasNameCallbackHandler} and * {@link JaasPasswordCallbackHandler}. */ public void afterPropertiesSet() throws Exception { Assert.hasLength(this.loginContextName, "loginContextName cannot be null or empty"); Assert.notEmpty(this.authorityGranters, "authorityGranters cannot be null or empty"); if (ObjectUtils.isEmpty(this.callbackHandlers)) { setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new JaasNameCallbackHandler(), new JaasPasswordCallbackHandler() }); } Assert.notNull(this.loginExceptionResolver, "loginExceptionResolver cannot be null"); }