使用 OAuth 从 google 帐户检索文档
我需要知道如何从特定用户获取文档,该用户使用...进行身份验证。
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
当用户经过身份验证时,我需要从谷歌文档获取文档。我知道我必须使用 OAuth,但我无法正确使用它。
我希望有人可以帮助我,谢谢。
I need to know how to obtain documents from a specific user, the user is authenticated using ...
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
When the user is authenticated , I need to get the documents from google docs. I know I have to use OAuth, but I could not use it correctly.
I hope some one can help me, Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是一个很好的参考,其中包含比我自己提供的更多信息:
http://code.google.com/apis/documents/docs/3.0/developers_guide_java.html
这应该会让您走上正确的道路。
Here is a good reference with way more information than I could provide myself:
http://code.google.com/apis/documents/docs/3.0/developers_guide_java.html
That should get you on the right path.
用户已通过 App Engine 身份验证,但尚未针对任何其他服务进行身份验证,或向您提供对这些服务的访问权限。您不能使用他们的 App Engine 凭据来访问任何其他服务;您需要遵循标准 OAuth 授权程序才能访问该用户拥有的任何其他服务。
The user has authenticated to App Engine, but they have not authenticated against any other services, or provided you with access to them. You cannot use their App Engine credentials to access any other services; you will need to follow the standard OAuth authorization procedure in order to access any other services owned by that user.
(查看 Google 的示例代码)
TOKEN_SECRET 您可以访问 Google 文档服务,如下面的代码片段。
(注意:CONSUMER_KEY 和 CONSUMER_SECRET 是您从 google 获取并在步骤 1 中使用的密钥。ACCESS_TOKEN 和 TOKEN_SECRET 是您在步骤 1 中完成 oauth 过程后由 google auth 服务器发送给您的秘密访问令牌)
希望这会有所帮助。
( look at there sample code for Google)
TOKEN_SECRET you can access google docs service like code snippet below .
(note : CONSUMER_KEY & CONSUMER_SECRET are the ones you get from google and used in step 1 . ACCESS_TOKEN & TOKEN_SECRET are the secret access tokens sent to you by google auth server after you complete oauth process in step 1)
hope this helps.