oauth problem( app engine)

Posted by portoalet on Stack Overflow See other posts from Stack Overflow or by portoalet
Published on 2009-11-08T19:18:29Z Indexed on 2010/04/03 16:03 UTC
Read the original article Hit count: 263

Filed under:

hi

i am trying to pull user's documents data from google docs using oauth, but i cannot understand how to do it
- what's the purpose of oauth_verifier
- how to get the access token secret?
- if i try to use DocsService below, then i have a "server error"
- is there a clear tutorial for this? i cannot find any atm..

    String oauth_verifier = req.getParameter("oauth_verifier");
	String oauth_token = req.getParameter("oauth_token");
	String oauthtokensecret = req.getParameter("oauth_token_secret");

	GoogleOAuthParameters oauthparam = new GoogleOAuthParameters();
	oauthparam.setOAuthConsumerKey("consumer key");
	oauthparam.setOAuthConsumerSecret("secret");
	oauthparam.setOAuthToken(oauth_token);
	oauthparam.setOAuthTokenSecret(oauthtokensecret);
	oauthparam.setOAuthVerifier(oauth_verifier);

	OAuthHmacSha1Signer signer = new OAuthHmacSha1Signer();
	GoogleOAuthHelper oauthhelper = new GoogleOAuthHelper(signer);
	String accesstoken = "";
	String accesstokensecret = "";

	try {
		oauthhelper.getUnauthorizedRequestToken(oauthparam);
		accesstoken = oauthhelper.getAccessToken(oauthparam);
		accesstokensecret = oauthparam.getOAuthTokenSecret();

// DocsService client = new DocsService("yourCompany-YourAppName-v1"); ...

© Stack Overflow or respective owner

Related posts about oauth