本文介绍了如何在没有用户互动的情况下验证Google Calendar API v3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google和外部日历同步(控制台应用程序)。我已经尝试了几种方法在Delphi中连接到我的日历。在最新版本的Google API中,您可以选择以下两种选择:


  • API密钥(公共日历)

  • OAuth2.0(私人日历)



日历不公开。我看了几个例子,但到处都需要用户交互。我想确认自己没有用户交互。我怎么能这样做?

解决方案

我不知道在Delphi中使用它,但有一个客户端API库,用于Java ,python ...我已经使用了java,并且清楚地解释了如何在文档中使用它。



Google Calendar API 3文档页面:



然而,该服务会要求您验证使用它(如果我理解的很好,您不希望用户必须进行身份验证,这是您的问题)。所以我建议你看看OAuth2.0。

以下是一些使用google-api-java-client的例子:



您应该更精确地查看Google OAuth服务帐户的可能性。
使用OAuth2.0的服务帐户。 (请参阅此处:)。
它会为您的应用程序提供一个服务帐户,您可以从中为您的应用程序处理日历。



在这里您会看到一个示例如何用Java做到这一点。 ()。但是,也许这是您所说的公共API密钥...不知道我是否记得正确。



我希望这可以帮助您找出如何做到这一点。

I'm using Google and external calendar sync (console application). I've tried several ways to connect to my calendar in Delphi. In the latest version of the Google API, you can choose two options:

  • API Key (public calendar)
  • OAuth2.0 (private calendar)

The calendar is not public. I looked at a couple of examples, but everywhere the need for user interaction. I want to identify myself with no user interaction. How can I do that?

解决方案

I don't know about using it in Delphi but there is a client API library for java, python... I've already used the java one and it's clearly explained how to use it in the documentation.

Google Calendar API 3 Doc page:https://developers.google.com/google-apps/calendar/

However, the service asks you to be authentified to used it (which is your problem if I understand it well, you don't want the user to have to authenticate). So I suggest you to have a look on OAuth2.0. https://developers.google.com/google-apps/calendar/auth

Here are some simple of using google-api-java-client for exemple : https://code.google.com/p/google-api-java-client/wiki/OAuth2

And you should look more precisely at Google OAuth service account possibilities.Service Account with OAuth2.0. (See here : https://developers.google.com/accounts/docs/OAuth2#serviceaccount).It will provide a service account for your application, from which you will be able to handle calendars for your app.

And here you will find a sample showing how to do it with Java. (https://code.google.com/p/google-api-java-client/wiki/OAuth2#Service_Accounts). But maybe this is the public API Key you are talking about... Not sure I remember properly.

I hope this will help you to figure out how to do it.

这篇关于如何在没有用户互动的情况下验证Google Calendar API v3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 00:58
查看更多