List of usage examples for org.springframework.security.oauth2.client.resource OAuth2AccessDeniedException getSummary
public String getSummary()
From source file:org.cloudfoundry.client.lib.oauth2.OauthClient.java
private OAuth2AccessToken createToken(String username, String password, String clientId, String clientSecret) { OAuth2ProtectedResourceDetails resource = getResourceDetails(username, password, clientId, clientSecret); AccessTokenRequest request = createAccessTokenRequest(username, password); ResourceOwnerPasswordAccessTokenProvider provider = createResourceOwnerPasswordAccessTokenProvider(); try {/*from w w w . jav a2 s. c o m*/ return provider.obtainAccessToken(resource, request); } catch (OAuth2AccessDeniedException oauthEx) { HttpStatus status = HttpStatus.valueOf(oauthEx.getHttpErrorCode()); CloudFoundryException cfEx = new CloudFoundryException(status, oauthEx.getMessage()); cfEx.setDescription(oauthEx.getSummary()); throw cfEx; } }