In this snippet:
@RequestMapping(method = GET)
public List<Place> read(Principal principal) {
principal.getName();
}
principal.getName()
gives me the user identification but I need a way to receive the client credentials (client => the app who is using my API). How can I do this?
I found a reasonable solution based on @luke-taylor answer.
@RequestMapping(method = GET)
public List<Place> read(OAuth2Authentication auth) {
auth.getOAuth2Request().getClientId()
}