使用 OAuth 2.0 进行 Java 和 Google 电子表格 API 授权 [英] Java and Google Spreadsheets API Authorization with OAuth 2.0

查看:29
本文介绍了使用 OAuth 2.0 进行 Java 和 Google 电子表格 API 授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 Java 阅读 Google 电子表格,推荐的方法是使用 Google 电子表格 API.

I want to read Google Spreadsheets using Java, and the recommended way to do this is using the Google Spreadsheets API.

当您想让程序安全时,问题就开始了,因此他们鼓励您使用 OAuth 2.0.在官方页面中,他们展示了如何仅使用 .NET 执行此操作并说Java 客户端库当前不支持 OAuth 2.0",他们提供了替代方案,例如使用 OAuth 1.0Client Login 直接使用 电子邮件密码.

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.

这是肯定的吗?有没有办法通过 Java 进行 OAuth 2.0 身份验证,也许不是直接使用 Java 客户端库,而是通过具有特定参数的请求.

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.

推荐答案

Google Data Java Client Library 现在支持 OAuth 2.0:

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:

这篇关于使用 OAuth 2.0 进行 Java 和 Google 电子表格 API 授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆