Hi all,
I developed a Chrome extension, in which I used OAuth. I make user login
with google account:
--------------code--------------------
var oauth = ChromeExOAuth.initBackgroundPage({
'request_url' : 'https://www.google.com/accounts/OAuthGetRequestToken',
'authorize_url' : 'https://www.google.com/accounts/OAuthAuthorizeToken',
'access_url' : 'https://www.google.com/accounts/OAuthGetAccessToken',
'consumer_key' : 'anonymous',
'consumer_secret' : 'anonymous',
'scope' : 'http://www.google.com/m8/feeds/',
'app_name' : 'myExtension'
});
--------------code--------------------
And then, I let the user visit my web application (myWebAppUrl):
--------------code--------------------
oauth.sendSignedRequest(myWebAppUrl, function(responseText, req) {
if (req.status == 200) {
//access sucessful ....
} else {
//access failed ......
}
}, {
'method': 'GET',
'headers': {
'X-Same-Domain': 'true',
'Content-Type': 'application/json;charset=UTF-8'
}
});
--------------code--------------------
In the servlet of my web application, I can get user's request with 6 OAuth
parameters:
--------------code--------------------
oauth_consumer_key=anonymous
oauth_nonce=******
oauth_signature=*******
oauth_signature_method=HMAC-SHA1
oauth_timestamp=1319428871
oauth_token=**********
--------------code--------------------
My question is:
In my servlet, can I use this 6 parameters to access Google Contacts API and
get user's username?
If can, how can I do it?
Thank you very much.
--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html