问题描述
我是一个相当有初学者,此刻学习如何使用API的正确:我从通过code.google.com / P /谷歌API-Java的客户端导入的.jar文件,并添加他们外部JAR文件在Eclipse中构建路径。
I am quite a beginner and learn at the moment "how to use apis properly": I imported the .jar files from code.google.com/p/google-api-java-client and added them via "external jar files" to the build path in eclipse.
https://developers.google的code片段.COM /博客/文档/ 3.0 /参考/职位/插入自OAuth2Native和BloggerScopes不被识别,因为人们必须onself第一认证不能工作独立。有人可以帮助我,让有关如何在自己最简单的方式进行身份验证的建议?
The code snippet from https://developers.google.com/blogger/docs/3.0/reference/posts/insert can't work standalone since OAuth2Native and BloggerScopes aren't recognized because one has to authenticate onself first. can someone help me with this, giving advice about how to authenticate oneself in the simplest possible way?
我已经发现了这一点:
i already found this:https://code.google.com/p/google-api-java-client/wiki/OAuth2Draft10
推荐答案
您可以找到谷歌的样本 OAuth2Native
实施<一个href=\"https://$c$c.google.com/p/google-api-java-client/source/browse/shared/shared-sample-cmdline/src/main/java/com/google/api/services/samples/shared/cmdline/oauth2/OAuth2Native.java?repo=samples&name=based-on-1.9\"相对=nofollow>这里。
You can find Google's sample OAuth2Native
implementation here.
有关失踪的范围不变,只是构建一个数组手动Blogger的范围:
For the missing scope constant, just construct an array with the Blogger scope manually:
final static String[] Blogger = { "https://www.googleapis.com/auth/blogger" };
这篇关于发布与谷歌的API-Java的客户端到Blogger的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!