{
ServiceActionContext currentContext = new ServiceActionContext(inConsumerKey, null);
OAuthConsumer consumer =
(OAuthConsumer) actionController.execute(currentContext, getOAuthConsumerByConsumerKeyAction);
BaseConsumerDetails details = new BaseConsumerDetails();
details.setConsumerKey(inConsumerKey);
details.setConsumerName(inConsumerKey);
details.setSignatureSecret(new SharedConsumerSecret(consumer.consumerSecret));
details.setAuthorities(grantedAuthorities);
// NOTE: This line supports OAuth 2-legged only!
details.setRequiredToObtainAuthenticatedToken(false);
return details;
}
catch (Exception ex)
{