Я пытаюсь запустить отличный скрипт, который вызывает API Linkedin. Вопрос в том, как я могу аутентифицироваться с помощью плагина Grails oauth из встроенного скрипта? Это мой конфиг:grails oauth from groovy script
oauth {
linkedin {
requestTokenUrl="https://api.linkedin.com/uas/oauth/requestToken"
accessTokenUrl="https://api.linkedin.com/uas/oauth/accessToken"
authUrl="https://www.linkedin.com/uas/oauth/authenticate"
consumer.key="xxxxxxxxx"
consumer.secret="xxxxxxxxxx"
}
}
Это мой сценарий, который я начинаю с «Grails выполнения сценария scriptname.groovy»:
import org.grails.plugins.oauth.OauthService
def oauthService = new OauthService()
oauthService.reset()
def URL = "http://api.linkedin.com/v1/people-search?country-code=us&postal-code=98102&distance=100&start=0&count=5"
def recs_response = oauthService.accessResource(URL, "linkedin", [key:"xxxxxxx", secret:"xxxxxxxxx"], 'GET')
println "it worked"
Если я печатаю ответ я получаю «использовал маркер в запросе OAuth недействительно "
Спасибо.