Hi Ravindra,

When the access token is expired, using the refresh token we can obtain a
new token. Are we storing back the new token for the consequent calls? or
are we getting a new token for each execution cycle?

Best Regards,
Malaka

On Fri, Oct 17, 2014 at 8:55 AM, Ravindra Ranwala <ravin...@wso2.com> wrote:

> Hi Manoj,
>
> I have given this proxy configuration just for testing purposes. But you
> can use our iPAAS recipe app to fetch the access tokens and refresh tokens.
> Here we are using refresh tokens for offline access to a protected
> resource. If the Access token is expired, we may use the refresh token to
> obtain a new one. User should have access and refresh tokens obtained
> beforehand to use this. The connector uses those tokens to access
> resources. For an example read set of Tweets from a tweeter account and
> write them back to a Google spreadsheet. You may parametrize this and
> trigger an ESB task to get the work done.
>
>
> Thanks & Regards,
>
> On Fri, Oct 17, 2014 at 8:20 AM, Manoj Gunawardena <man...@wso2.com>
> wrote:
>
>> Hi Ravindra,
>>
>> proxy contains oauth acess token and refresh token, How those tokens
>> fetch? Is there a service to fetch those token. Once the tokens expires,
>> how new tokens add to the proxy? This proxy creates dynamically?
>>
>>
>> Thanks
>>
>> On Thu, Oct 16, 2014 at 8:33 AM, Ravindra Ranwala <ravin...@wso2.com>
>> wrote:
>>
>>> Hi All,
>>>
>>> I have added OAuth 2 Authorization support for Google spreadsheet
>>> connector. Using that now we can create a proxy/recipe which filters out
>>> set of tweets from the twitter connector and writes back to a Google
>>> spreadsheet via Google spreadsheet OAuth 2 connector support. I have given
>>> the git repo location here.
>>>
>>>
>>> https://github.com/ravindraranwala/esb-connectors/tree/googlespreadsheet-OAuth2
>>>
>>> When you create the proxy/recipe please build the above project and use
>>> the Google spreadsheet connector created under the target directory and
>>> upload it to the ESB.Make sure to explicitly enable the connector once
>>> uploaded since it is disabled by default.
>>>
>>> A sample Proxy Configuration to read set of Tweets and write it back to
>>> a Google spread sheet is given below. The changes compared to the Google
>>> spreadsheet OAuth 1.0 configuration is highlighted here.
>>>
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <proxy xmlns="http://ws.apache.org/ns/synapse";
>>>        name="
>>> twitterToGoogleSpreadsheetProxy"
>>>        transports="https,http"
>>>        statistics="disable"
>>>        trace="disable"
>>>        startOnLoad="true">
>>>    <target>
>>>       <inSequence>
>>>          <twitter.init>
>>>             <consumerKey>TWITTER_CONSUMER_KEY</consumerKey>
>>>             <consumerSecret>TWITTER_CONSUMER_SECRET</consumerSecret>
>>>             <accessToken>TWITTER_ACCESS_TOKEN</accessToken>
>>>
>>> <accessTokenSecret>TWITTER_ACCESS_TOKEN_SECRET</accessTokenSecret>
>>>          </twitter.init>
>>>          <twitter.search>
>>>             <search>tuesday</search>
>>>             <lang>en</lang>
>>>          </twitter.search>
>>>          <xslt key="twitterTransform"/>
>>>          <log level="full"/>
>>>          *<googlespreadsheet.oAuth2init>*
>>>             <oauthConsumerKey>GOOGLE_CONSUMER_KEY
>>> <http://212972391932-3thmh0maoodoin7t116vb0adpjjvckv0.apps.googleusercontent.com>
>>> </oauthConsumerKey>
>>>
>>> <oauthConsumerSecret>GOOGLE_CONSUMER_SECRET</oauthConsumerSecret>
>>>
>>> *
>>> <oauthAccessToken>GOOGLE_ACCESS_TOKEN</oauthAccessToken>
>>> <oauthRefreshToken>GOOGLE_REFRESH_TOKEN</oauthRefreshToken>*
>>>          *</googlespreadsheet.oAuth2init>*
>>>          <googlespreadsheet.importCSV>
>>>             <spreadsheetName>Tweets</spreadsheetName>
>>>             <worksheetName>Sheet1</worksheetName>
>>>             <batchEnable>true</batchEnable>
>>>             <batchSize>100</batchSize>
>>>          </googlespreadsheet.importCSV>
>>>          <respond/>
>>>       </inSequence>
>>>    </target>
>>>    <description/>
>>> </proxy>
>>>
>>>
>>> Thanks & Regards,
>>>
>>>
>>> --
>>> Ravindra Ranwala
>>> Software Engineer
>>> WSO2, Inc: http://wso2.com
>>> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
>>> Mobile: +94714198770
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Manoj Gunawardena
>> Tech Lead
>> WSO2, Inc.: http://wso2.com
>> lean.enterprise.middleware
>> Mobile : +94 77 2291643
>>
>
>
>
> --
> Ravindra Ranwala
> Software Engineer
> WSO2, Inc: http://wso2.com
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> Mobile: +94714198770
>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Tel : 94 11 214 5345
Fax :94 11 2145300
Skype : malaka.sampath.silva
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
Blog : http://mrmalakasilva.blogspot.com/

WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
http://www.wso2.com/about/team/malaka-silva/
<http://wso2.com/about/team/malaka-silva/>

Save a tree -Conserve nature & Save the world for your future. Print this
email only if it is absolutely necessary.
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to