Skip to content

Commit d4592c2

Browse files
committed
added oauth page
1 parent eb48ad5 commit d4592c2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/site/apt/oauth.apt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
------
2+
Async Http Client - Using OAuth
3+
------
4+
Jeanfrancois Arcand
5+
------
6+
2012
7+
8+
Using OAuth
9+
10+
You can use the library to pull data from any OAuth site (like Twitter). This is as simple as:
11+
12+
+-----+
13+
private static final String CONSUMER_KEY = "dpf43f3p2l4k3l03";
14+
private static final String CONSUMER_SECRET = "kd94hf93k423k f44";
15+
public static final String TOKEN_KEY = "nnch734d00sl2jdk";
16+
public static final String TOKEN_SECRET = "pfkkdhi9sl3r4s00";
17+
public static final String NONCE = "kllo9940pd9333jh";
18+
final static long TIMESTAMP = 1191242096;
19+
20+
public void oAuth() {
21+
ConsumerKey consumer = new ConsumerKey(CONSUMER_KEY, CONSUMER_SECRET);
22+
RequestToken user = new RequestToken(TOKEN_KEY, TOKEN_SECRET);
23+
OAuthSignatureCalculator calc = new OAuthSignatureCalculator(consumer, user);
24+
AsyncHttpClient client = new AsyncHttpClient();
25+
Response response = client.prepareGet("http://...").setSignatureCalculator(calc).execute().get();
26+
+-----+

0 commit comments

Comments
 (0)