}
JerseyClient oauthClient = new JerseyClientImpl(null);
// TODO: Use a custom error deserialiser in the following post
result = oauthClient.post(Configuration.Current.getOAuthBaseUri(),
OAuthTokenDetails.class, body,
MediaType.APPLICATION_FORM_URLENCODED_TYPE, "token");
if (result != null && result.access_token != null
&& result.refresh_token != null) {
AuthenticationDetails newAuthDetails = new OAuthAuthenticationDetails(