forked from yql/yql-tables
/
auth.oauth.request_token.xml
50 lines (43 loc) · 2.1 KB
/
auth.oauth.request_token.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8" ?>
<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<sampleQuery>select * from auth.oauth.request_token where oauth_callback="test" and oauth_version="1.0" and oauth_signature_method="HMAC-SHA1" and oauth_consumer_key="a90dd5cb7136513d" and get_request_token_url="http://oauth-sandbox.sevengoslings.net/request_token" and consumer_secret="0e5ab8a0d69451a8a8d58d1b6d8c";</sampleQuery>
</meta>
<bindings>
<select itemPath="" produces="XML">
<urls>
<url></url>
</urls>
<inputs>
<key id="get_request_token_url" type="xs:string" paramType="variable" required="true" />
<key id="consumer_secret" type="xs:string" paramType="variable" required="true" />
<key id="oauth_consumer_key" type="xs:string" paramType="variable" required="true" />
<key id="oauth_signature_method" type="xs:string" paramType="variable" required="true" />
<key id="oauth_version" type="xs:string" paramType="variable" required="true" />
<key id="oauth_callback" type="xs:string" paramType="variable" required="true" />
</inputs>
<execute><![CDATA[
var document = {
getElementsByTagName: function(value) {
return null;
}
};
y.include("http://oauth.googlecode.com/svn/code/javascript/oauth.js");
y.include("http://oauth.googlecode.com/svn/code/javascript/sha1.js");
var get_url = get_request_token_url;
var local_accessor = { consumerKey:oauth_consumer_key, consumerSecret:consumer_secret, token:'', tokenSecret:'' };
var message = {};
message.action = get_request_token_url;
message.method = "GET";
OAuth.setTimestampAndNonce(message);
OAuth.setParameter(message, "oauth_consumer_key", oauth_consumer_key);
OAuth.setParameter(message, "oauth_signature_method", oauth_signature_method);
OAuth.setParameter(message, "oauth_version", oauth_version);
OAuth.setParameter(message, "oauth_callback", oauth_callback);
OAuth.SignatureMethod.sign(message, local_accessor);
get_url = OAuth.addToURL(get_url, message.parameters);
response.object = y.rest(get_url).get().response;
]]></execute>
</select>
</bindings>
</table>