本文介绍了使用OAuth 2.0的Java和Google Spreadsheets API授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想使用Java阅读Google电子表格,推荐的方法是使用 Google Spreadsheets API 。 当您想让程序安全时,问题就开始了,所以他们鼓励您使用OAuth 2.0。在官方页面中,他们展示了如何仅使用.NET来完成此操作,并说 Java客户端库目前不支持OAuth 2.0 ,并且它们提供了诸如使用 OAuth 1.0 或客户端登录直接使用电子邮件和密码。 这是肯定的吗?没有办法通过Java进行OAuth 2.0身份验证,可能不是直接使用Java客户端库,而是通过具有特定参数的请求。 请任何我感谢建议。解决方案 Google数据Java客户端库现在支持OAuth 2.0: https://code.google.com/ p / gdata-java-client / source / detail?r = 505 不幸的是,没有完整的展示如何使用它的库中的示例。我建议您检查这两个链接,将这些信息放在一起以使其正常工作: https://code.google.com/p/google-oauth-java-client/wiki/OAuth2 https: //code.google.com/p/google-api-java-client/wiki/OAuth2 I want to read Google Spreadsheets using Java, and the recommended way to do this is using the Google Spreadsheets API.The problem begins when you want to make procedures secure, so they encourage you to use OAuth 2.0. In the official page they show how to do this using only .NET and say that "the Java client library doesn't currently support OAuth 2.0", and they give alternatives like using OAuth 1.0 or Client Login using directly email and password.Is this for sure?, isn't there a way to do OAuth 2.0 Authentication through Java, maybe not using directly the Java client library, but through requests with specific parameters.Please I would appreciate any suggestions. 解决方案 The Google Data Java Client Library now supports OAuth 2.0:https://code.google.com/p/gdata-java-client/source/detail?r=505Unfortunately, there are no complete samples in the library showing how to use it. I'd recommend checking these two links to put together the information to make it work:https://code.google.com/p/google-oauth-java-client/wiki/OAuth2https://code.google.com/p/google-api-java-client/wiki/OAuth2 这篇关于使用OAuth 2.0的Java和Google Spreadsheets API授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!