mulesoft Google Connector创建事件
尝试使用Google Connector从Anypoint Studio创建Google Event时,我要低于错误。
oauth授权舞蹈尚未为resourceownerid null
表演
基本上以测试此功能,我在下面
- 进行了侦听器连接器(路径:/hello),并配置了本地主机8081
- 拖动Google Calendar Eventer insert insert insert Connector,并配置了下面的详细信息
- base url: https://www.googleapis.com/calendar/calendar/v3 /li>
- 消费者秘密:输入公司Clent ID
- 消费者秘密:输入秘密密钥
- 授权URL: https://accounts.google.com/o/o/oauth2/auth2/auth2/auth2/auth2/auth2/auth < /a>
- 访问令牌网址: https://accounts.google.com/o/o/oauth2/oauth2/token
- scopes: https://wwwwwwwww.googleapis.com/auth/auth/calendar/calendar href =“ https://www.googleapis.com/auth/calendar.events” rel =“ nofollow noreferrer”> https://www.googleapis.com/auth/auth/calendar/calendar.events https://www.googleapis.com/auth/calendar.events.readonly“ rel =“ nofollow noreferrer”> https://wwwwww.googleapis.com/auth/calendar.events.events.readonly.readonly “ https://www.googleapis.com/auth/calendar.readonly” rel =“ nofollow noreferrer”> https://www.googleapis.com/auth/auth/calendar.readonly.readonly.readonly //www.googleapis.com/auth/calendar.settings.readonly“ rel =“ nofollow noreferrer”> https://www.googleapis.com/auth/calendar/calendar.settings.readonly.readonly
- 回电路径: /oauth2callback < /li>
- 授权路径: /授权< /li>
- 外部回调URL:http:// localhost:8081/oauth2callback
我在Google Calendar Connecter中留下的剩余字段留下了。
- ,HTTP侦听器和Google Calendar Events插入连接器之间的资源所有者ID
- 资源所有者在
- 之间
- 对象存储
,我在下面的DataWeave下面放置了转换消息,
%dw 2.0
output application/json
---
{
summary: payload.summary,
start: {
dateTime: payload.start.dateTime,
timeZone: payload.start.timeZone
},
end: {
dateTime: payload.end.dateTime,
timeZone: payload.end.timeZone
}
}
是我从Postman提供的JSON输入,URL为http:// local -Host :8081/Hello
{
"end": {
"datetime": "2022-05-19T16:00:00+05:30",
"timezone":Asia/Chennai
},
"start": {
"datetime": "2022-05-19T14:00:00+05:30",
"timezone":Asia/Chennai
},
"summary":"First PO from Mulesoft Google connector",
"description":"First desc from Mulesoft Google connector",
"location":"Hyderabad",
"attendees":[
{
"email":"[email protected]"
}
]
}
我正在使用Anypoint Studio 7.8.0。
提前致谢。
I'm getting below error when trying to create a google event from anypoint studio using google connector.
OAuth authorization dance not yet performed for resourceOwnerId null
Basically to test this functionality, I did below
- I took a listener connector (path:/hello) and configured with local host 8081
- Dragged google calendar event insert connector and configured with below details
- Base url: https://www.googleapis.com/calendar/v3
- consumer secret : Entered corporate clent id
- Consumer secret:Entered secret key
- Authorization url : https://accounts.google.com/o/oauth2/auth
- Access token url : https://accounts.google.com/o/oauth2/token
- Scopes: https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/calendar.events https://www.googleapis.com/auth/calendar.events.readonly https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/calendar.settings.readonly
- Call back path : /oauth2callback
- Authorize path : /authorize
- external callback url : http://localhost:8081/oauth2callback
I left remaining below fields empty in the google calendar connecter.
- Resource Owner id
- Before
- after
- Object store
In between, HTTP Listener and Google calendar events Insert connecter, I placed Transform message and written below Dataweave
%dw 2.0
output application/json
---
{
summary: payload.summary,
start: {
dateTime: payload.start.dateTime,
timeZone: payload.start.timeZone
},
end: {
dateTime: payload.end.dateTime,
timeZone: payload.end.timeZone
}
}
Below is the JSON input I'm giving from the postman, url being http://localhost:8081/hello
{
"end": {
"datetime": "2022-05-19T16:00:00+05:30",
"timezone":Asia/Chennai
},
"start": {
"datetime": "2022-05-19T14:00:00+05:30",
"timezone":Asia/Chennai
},
"summary":"First PO from Mulesoft Google connector",
"description":"First desc from Mulesoft Google connector",
"location":"Hyderabad",
"attendees":[
{
"email":"[email protected]"
}
]
}
I'm using anypoint studio 7.8.0.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要首先开始Oauth Dance,以获取访问令牌。
您可以通过在应用程序中配置的授权路径开始,在您的情况下是
http:// localhost:8081/授权
之后,您将成为您。重定向到Google登录页面。如果正确配置了Google OAuth凭据,则m子应用将获取访问令牌并将其用于将来的请求。
You need to start the OAuth dance first, to get the access token.
You can start it by hitting the
Authorize path
that you have configured in your app, which in your case ishttp://localhost:8081/authorize
After that you will be redirected to Google sign in page. If the Google oauth credentials are configured correctly the mule app will get the access token and use it for the future requests.