*/
@Override
public ConsumerInfo getConsumerKeyAndSecret(SecurityToken securityToken, String serviceName,
OAuthServiceProvider provider) throws GadgetException {
String gadgetUri = securityToken.getAppUrl();
OAuthConsumerStore consumerStore = consumerStoreService.findByUriAndServiceName(gadgetUri, serviceName);
if (consumerStore == null) {
return null;
}
OAuthConsumer consumer = createOAuthConsumer(provider, consumerStore);
String callbackUrl = (consumerStore.getCallbackUrl() != null ?
consumerStore.getCallbackUrl() : defaultCallbackUrl);
return new ConsumerInfo(consumer, consumerStore.getKeyName(), callbackUrl);
}