首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Google任务/日历

Google任务/日历
EN

Stack Overflow用户
提问于 2013-05-03 21:48:24
回答 1查看 294关注 0票数 2

我正在玩Google Task connector,结果出现了以下错误

The content of element 'google-tasks:config-with-oauth' is not complete. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/google-tasks":oauth-callback-config}' is expected.

这是我的配置

代码语言:javascript
复制
 <google-tasks:config-with-oauth name="Google_Tasks"
 consumerKey="sagitec.mygbiz.com"
 consumerSecret="oeX9wb_GhldQJYjHKLDqC-EB" doc:name="Google Tasks"/>
     <flow name="google_taskFlow1" doc:name="google_taskFlow1">
         <http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" doc:name="HTTP"/>
         <google-tasks:authorize config-ref="Google_Tasks" accessTokenUrl="https://accounts.google.com/o/oauth2/token"
 authorizationUrl="https://accounts.google.com/o/oauth2/auth"
 access_type="online" force_prompt="auto" doc:name="Google Tasks"/>
         <logger level="INFO" doc:name="Logger" message="#[payload]"/> </flow>

如果我在google-tasks:config-with-oauth的Oauth选项卡下的Domain (指定为可选)中输入"localhost“,我不会得到任何构建错误。

所以我的第一个问题是,我必须在Domain下输入什么值,以及我可以从哪里获得它。

2) Consumer Key/Secret和ClientKey/secret有什么区别。

3)在其中一个示例中,我看到了${google.apiKey}。这是什么,如果这是一个变量,wgere以及如何声明它。

如果能提供任何样品,那就太好了。

提前谢谢你,卡南

EN

回答 1

Stack Overflow用户

发布于 2015-07-09 16:16:49

在这里,我添加了使用google connector进行google calender身份验证的示例

你的

客户端id >>consumerKey

client secret >> consumerSecret

${google.apiKey}在下面的流程中>>你的全局谷歌日历配置名称,即name=“Google_Calendars

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>

    <mule xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-   mapper" xmlns:json="http://www.mulesoft.org/schema/mule/json"
    xmlns:https="http://www.mulesoft.org/schema/mule/https" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking"
    xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
    xmlns:http="http://www.mulesoft.org/schema/mule/http"
    xmlns:google-calendars="http://www.mulesoft.org/schema/mule/google-calendars"
    xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
    xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.5.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/google-calendars http://www.mulesoft.org/schema/mule/google-calendars/1.0/mule-google-calendars.xsd
http://www.mulesoft.org/schema/mule/objectstore http://www.mulesoft.org/schema/mule/objectstore/1.0/mule-objectstore.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/https http://www.mulesoft.org/schema/mule/https/current/mule-https.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd">

    <google-calendars:config-with-oauth
        name="Google_Calendars"
        consumerKey="${consumer-key}"
        consumerSecret="${consumer-secret}" doc:name="Google Calendars"
        applicationName="test">
        <google-calendars:oauth-callback-config
            domain="localhost" localPort="8083" path="list"
            remotePort="8083"  />
        <google-calendars:oauth-store-config objectStore-ref="ObjectStoreBean" />
    </google-calendars:config-with-oauth>


    <spring:beans>
        <spring:bean id="ObjectStoreBean" name="ObjectStoreBean"
            class="org.mule.util.store.SimpleMemoryObjectStore" />
    </spring:beans>
    <flow name="authorizationAndAuthenticationFlow" doc:name="authorizationAndAuthenticationFlow">
        <http:inbound-endpoint host="localhost" port="8080"
            path="oauth-authorize" doc:name="HTTP" />
        <google-calendars:authorize config-ref="Google_Calendars"
            doc:name="Google Calendars" />
        <http:response-builder status="200"
            doc:name="HTTP Response Builder">
            <set-payload value="You have successfully authorized the connector" />
        </http:response-builder>
        <catch-exception-strategy doc:name="Catch Exception Strategy">
            <http:response-builder status="404"
                doc:name="HTTP Response Builder">
                <set-payload value="An error has occurred authorizing the connector" />
            </http:response-builder>
        </catch-exception-strategy>
    </flow>     

</mule>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16360483

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档