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:
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user