Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
java 11 branch
  • Loading branch information
theanuradha committed Apr 9, 2020
commit e0c49a3a2f42f9a0db95453f597f84596b5400d5
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public UserDetails loadUserByUsername(String clientId) throws UsernameNotFoundE
} else {
throw new UsernameNotFoundException("Client not found: " + clientId);
}
} catch (UnsupportedEncodingException | InvalidClientException e) {
} catch ( InvalidClientException e) {
throw new UsernameNotFoundException("Client not found: " + clientId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ public String registerNewClient(@RequestBody String jsonString, Model m) {
m.addAttribute(HttpCodeView.CODE, HttpStatus.CREATED); // http 201

return ClientInformationResponseView.VIEWNAME;
} catch (UnsupportedEncodingException e) {
logger.error("Unsupported encoding", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
return HttpCodeView.VIEWNAME;
} catch (IllegalArgumentException e) {
logger.error("Couldn't save client", e);

Expand Down Expand Up @@ -284,7 +280,6 @@ public String readClientConfiguration(@PathVariable("id") String clientId, Model

if (client != null && client.getClientId().equals(auth.getOAuth2Request().getClientId())) {

try {
OAuth2AccessTokenEntity token = rotateRegistrationTokenIfNecessary(auth, client);
RegisteredClient registered = new RegisteredClient(client, token.getValue(), config.getIssuer() + "register/" + UriUtils.encodePathSegment(client.getClientId(), "UTF-8"));

Expand All @@ -293,11 +288,7 @@ public String readClientConfiguration(@PathVariable("id") String clientId, Model
m.addAttribute(HttpCodeView.CODE, HttpStatus.OK); // http 200

return ClientInformationResponseView.VIEWNAME;
} catch (UnsupportedEncodingException e) {
logger.error("Unsupported encoding", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
return HttpCodeView.VIEWNAME;
}


} else {
// client mismatch
Expand Down Expand Up @@ -382,11 +373,7 @@ public String updateClient(@PathVariable("id") String clientId, @RequestBody Str
m.addAttribute(HttpCodeView.CODE, HttpStatus.OK); // http 200

return ClientInformationResponseView.VIEWNAME;
} catch (UnsupportedEncodingException e) {
logger.error("Unsupported encoding", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
return HttpCodeView.VIEWNAME;
} catch (IllegalArgumentException e) {
}catch (IllegalArgumentException e) {
logger.error("Couldn't save client", e);

m.addAttribute(JsonErrorView.ERROR, "invalid_client_metadata");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,6 @@ public String registerNewProtectedResource(@RequestBody String jsonString, Model
m.addAttribute(HttpCodeView.CODE, HttpStatus.CREATED); // http 201

return ClientInformationResponseView.VIEWNAME;
} catch (UnsupportedEncodingException e) {
logger.error("Unsupported encoding", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
return HttpCodeView.VIEWNAME;
} catch (IllegalArgumentException e) {
logger.error("Couldn't save client", e);

Expand Down Expand Up @@ -234,7 +230,7 @@ public String readResourceConfiguration(@PathVariable("id") String clientId, Mod



try {

// possibly update the token
OAuth2AccessTokenEntity token = fetchValidRegistrationToken(auth, client);

Expand All @@ -245,11 +241,7 @@ public String readResourceConfiguration(@PathVariable("id") String clientId, Mod
m.addAttribute(HttpCodeView.CODE, HttpStatus.OK); // http 200

return ClientInformationResponseView.VIEWNAME;
} catch (UnsupportedEncodingException e) {
logger.error("Unsupported encoding", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
return HttpCodeView.VIEWNAME;
}

} else {
// client mismatch
logger.error("readResourceConfiguration failed, client ID mismatch: "
Expand Down Expand Up @@ -356,10 +348,6 @@ public String updateProtectedResource(@PathVariable("id") String clientId, @Requ
m.addAttribute(HttpCodeView.CODE, HttpStatus.OK); // http 200

return ClientInformationResponseView.VIEWNAME;
} catch (UnsupportedEncodingException e) {
logger.error("Unsupported encoding", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.INTERNAL_SERVER_ERROR);
return HttpCodeView.VIEWNAME;
} catch (IllegalArgumentException e) {
logger.error("Couldn't save client", e);

Expand Down
Loading