Fix some teething problems with OAuth2Sso

1) Validation of ResourceServerProperties should not fail if tokenInfoUri
is missing when it is not going to be used anyway

2) The OAuth2SsoConfigurer needs to declare a checked exception so
it can be used painlessly (since the HttpSecurity object that it gets
passed throws them for practically everything)
This commit is contained in:
Dave Syer
2014-09-10 18:34:44 -05:00
parent 7ca40861eb
commit 4252ccde9d
2 changed files with 2 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ public class ResourceServerProperties implements Validator {
"Missing userInfoUri (no client secret available)");
}
} else {
if (!StringUtils.hasText(resource.getTokenInfoUri())) {
if (isPreferTokenInfo() && !StringUtils.hasText(resource.getTokenInfoUri())) {
errors.rejectValue("tokenInfoUri", "missing.tokenInfoUri",
"Missing tokenInfoUri");
}

View File

@@ -23,6 +23,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
*/
public interface OAuth2SsoConfigurer {
void configure(HttpSecurity http);
void configure(HttpSecurity http) throws Exception;
}