added bean property check

pull/306/merge
Justin Richer 2013-03-14 16:36:21 -04:00
parent b1c89783ff
commit ecf99f960a
1 changed files with 13 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletRequest;
import org.apache.http.client.utils.URIBuilder;
import org.mitre.openid.connect.client.model.IssuerServiceResponse;
import org.mitre.openid.connect.client.service.IssuerService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.authentication.AuthenticationServiceException;
import com.google.common.base.Strings;
@ -21,7 +22,7 @@ import com.google.common.base.Strings;
* @author jricher
*
*/
public class ThirdPartyIssuerService implements IssuerService {
public class ThirdPartyIssuerService implements IssuerService, InitializingBean {
private String accountChooserUrl;
@ -68,4 +69,15 @@ public class ThirdPartyIssuerService implements IssuerService {
this.accountChooserUrl = accountChooserUrl;
}
/* (non-Javadoc)
* @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws Exception {
if (Strings.isNullOrEmpty(this.accountChooserUrl)) {
throw new IllegalArgumentException("Account Chooser URL cannot be null or empty");
}
}
}