Dave here is a question:
Code:
@RequestMapping
public ResponseEntity<OAuth2AccessToken> getAccessToken(Principal principal,
@RequestParam("grant_type") String grantType, @RequestParam Map<String, String> parameters) {
if (!(principal instanceof Authentication)) {
throw new InsufficientAuthenticationException(
"There is no client authentication. Try adding an appropriate authentication filter.");
}
Authentication client = (Authentication) principal;
if (!client.isAuthenticated()) {
throw new InsufficientAuthenticationException("The client is not authenticated.");
}
HashMap<String, String> request = new HashMap<String, String>(parameters);
String clientId = client.getName();
request.put("client_id", clientId);
getAuthorizationRequestManager().validateParameters(parameters,
getClientDetailsService().loadClientByClientId(clientId));
Shouldn't the clientId be pulled from the RequestParam and not the Principal when you are trying to loadClientByClientId?