我正在使用 grails Oauth 插件。而且我无法在谷歌日历中创建新活动。
服务代码:
def addNewEvent(String calendarId){
Token token=getGoogleAccessToken()
def calendars = oauthService.postGoogleResource(token, "https://www.googleapis.com/calendar/v3/calendars/${calendarId}/events?key=${grailsApplication.config.oauth.providers.google.key}", [end:'2013-09-26', start: '2013-09-26', summery: 'Testing'])
}
日志:
signing request: https://www.googleapis.com/calendar/v3/calendars/vrg3e08emcipgm4772u2iep2h4@group.calendar.google.com/events?key=163071926482.apps.googleusercontent.com
setting token to: Token[1/xxx-xxx , xxx_yyy]
generating signature...
base string is: POST&https%3A%2F%2Fwww.googleapis.com%2Fcalendar%2Fv3%2Fcalendars%2Fvrg3e08emcipgm4772u2iep2h4%40group.calendar.google.com%2Fevents&end%3D2013-09-26%26key%3D163df071926482.apps.googleusercontent.com%26oauth_consumer_key%3D1630719264df82.apps.googleusercontent.com%26oauth_nonce%3D254349338721%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1380260738%26oauth_token%3D1%252FSH5y9a8gO4AdG5bG3okN2348bi4tcxYdF-B3TL3jzN1kfw%26oauth_version%3D1.0%26scope%3Dhttps%253A%252F%252Fwww.googleapis.com%252Fauth%252Fcalendar%26start%3D2013-09-26%26title%3DTesting
signature is: ft/wk6omCDRh2Dk5jhC7NpBK1V4=
appended additional OAuth parameters: { oauth_signature -> ft/wk6omCDRh23Dk5jhC7NpBK1V4= , scope -> https://www.googleapis.com/auth/calendar , oauth_version -> 1.0 , oauth_nonce -> 2543498721 , oauth_signature_method -> HMAC-SHA1 , oauth_consumer_key -> 163071926482.apps.googleusercontent.com , oauth_token -> 1/SH5y9a8gO433AdG5bG3okN8bi4tcxYdF-B3TL3jzN1kfw , oauth_timestamp -> 1380260738 }
using Http Header signature
当我通过Google api Explorer拨打电话时,它正在工作。
谁能给我一些想法如何创建日历事件或我错在哪里?