且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用OAuth 2.0的Java和Google Spreadsheets API授权

更新时间:2023-02-15 15:58:04

Google数据Java客户端库现在支持OAuth 2.0:

https://code.google.com/ p / gdata-java-client / source / detail?r = 505



不幸的是,没有完整的展示如何使用它的库中的示例。我建议您检查这两个链接,将这些信息放在一起以使其正常工作:


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=505

Unfortunately, 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: