mulesoft Google Connector创建事件

发布于 2025-01-31 05:34:53 字数 3353 浏览 5 评论 0原文

尝试使用Google Connector从Anypoint Studio创建Google Event时,我要低于错误。

oauth授权舞蹈尚未为resourceownerid null

表演

基本上以测试此功能,我在下面

  1. 进行了侦听器连接器(路径:/hello),并配置了本地主机8081
  2. 拖动Google Calendar Eventer insert insert insert Connector,并配置了下面的详细信息
    1. base url: https://www.googleapis.com/calendar/calendar/v3 /li>
    2. 消费者秘密:输入公司Clent ID
    3. 消费者秘密:输入秘密密钥
    4. 授权URL: https://accounts.google.com/o/o/oauth2/auth2/auth2/auth2/auth2/auth2/auth < /a>
    5. 访问令牌网址: https://accounts.google.com/o/o/oauth2/oauth2/token
    6. 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
    7. 回电路径: /oauth2callback < /li>
    8. 授权路径: /授权< /li>
    9. 外部回调URL:http:// localhost:8081/oauth2callback

我在Google Calendar Connecter中留下的剩余字段留下了。

  1. ,HTTP侦听器和Google Calendar Events插入连接器之间的资源所有者ID
  2. 资源所有者在
  3. 之间
  4. 对象存储

,我在下面的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

  1. I took a listener connector (path:/hello) and configured with local host 8081
  2. Dragged google calendar event insert connector and configured with below details
    1. Base url: https://www.googleapis.com/calendar/v3
    2. consumer secret : Entered corporate clent id
    3. Consumer secret:Entered secret key
    4. Authorization url : https://accounts.google.com/o/oauth2/auth
    5. Access token url : https://accounts.google.com/o/oauth2/token
    6. 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
    7. Call back path : /oauth2callback
    8. Authorize path : /authorize
    9. external callback url : http://localhost:8081/oauth2callback

I left remaining below fields empty in the google calendar connecter.

  1. Resource Owner id
  2. Before
  3. after
  4. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给不了的爱 2025-02-07 05:34:53

您需要首先开始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 is http://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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文