0

我在一个使用 GAE 的项目中工作。

我有一个 GAE 应用程序,它使用来自其他 GAE 应用程序的 Rest 服务(这个应用程序使用不同的 Google API 和 2LO oauth2,例如:一个应用程序使用 Gcalendar Api,其他 Gmail Api,......)。REST 应用程序使用 Java 并使用 GoogleCredential 来使用 Google API。所有应用程序都在同一个域中(公司拥有所有项目)。

我需要将主要的 GAE 应用程序(也在 Java 中)从 2LO Oauth 1 迁移到 2LO Oauth2。

我看到了这个例子,但不是 2LO。https://code.google.com/p/google-oauth-java-client/wiki/Samples

我可以使用来自 Google-Oauth-api 或 GoogleCredential 的凭据吗?还是 GoogleCredential 仅适用于 Google API?

谢谢。

4

1 回答 1

0

This [1] is the 2LO OAuth 2.0 implementation of Google OAuth you can use on App Engine and is usually refereed as the OAuth for Server to Server Applications on public documentation. This method requires of a Service Account that you can obtain on the Google Developers Console of your app. More info here [2].

[1] https://developers.google.com/accounts/docs/OAuth2ServiceAccount

[2] https://developers.google.com/api-client-library/java/google-api-java-client/app-engine

于 2015-02-24T10:35:14.150 回答