added null checks in client filter

pull/324/merge
Justin Richer 2013-04-19 11:40:44 -04:00
parent 57cefa595a
commit 60525a52af
1 changed files with 15 additions and 0 deletions

View File

@ -157,10 +157,25 @@ public class OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFi
} else {
String issuer = issResp.getIssuer();
if (Strings.isNullOrEmpty(issuer)) {
logger.error("No issuer found: " + issuer);
throw new AuthenticationServiceException("No issuer found: " + issuer);
}
session.setAttribute(ISSUER_SESSION_VARIABLE, issuer);
ServerConfiguration serverConfig = servers.getServerConfiguration(issuer);
if (serverConfig == null) {
logger.error("No server configuration found for issuer: " + issuer);
throw new AuthenticationServiceException("No server configuration found for issuer: " + issuer);
}
ClientDetails clientConfig = clients.getClientConfiguration(issuer);
if (clientConfig == null) {
logger.error("No client configuration found for issuer: " + issuer);
throw new AuthenticationServiceException("No client configuration found for issuer: " + issuer);
}
// our redirect URI is this current URL, with no query parameters
String redirectUri = request.getRequestURL().toString();