* {@inheritDoc}. Get the OAuth consumer token info.
*/
@Override
public Serializable execute(final PrincipalActionContext inActionContext) throws ExecutionException
{
GetConsumerInfoRequest request = (GetConsumerInfoRequest) inActionContext.getParams();
OAuthConsumer oauthConsumer = consumerMapper.execute(new OAuthConsumerRequest(request.getServiceName(), request
.getSecurityToken().getAppUrl()));
if (oauthConsumer == null)
{
throw new ExecutionException("OAuth Consumer was not found");
}
net.oauth.OAuthConsumer consumer = new net.oauth.OAuthConsumer(oauthConsumer.getCallbackURL(), oauthConsumer
.getConsumerKey(), oauthConsumer.getConsumerSecret(), request.getProvider());
consumer.setProperty(OAuth.OAUTH_SIGNATURE_METHOD, oauthConsumer.getSignatureMethod());
ConsumerInfo consumerInfo = new ConsumerInfo(consumer, null, oauthConsumer.getCallbackURL());
return new ConsumerInfoResponse(consumerInfo);
}