如何从 google 获取访问令牌

How to obtain access tokens from google

如果我只注册了应用程序而没有要重定向的服务器(作为 "redirect_uri" 参数),如何从 google 获取 oauth 访问令牌?

您可以使用 https://www.example.com/oauth2callback 作为您的重定向 uri。

是的,您可以在没有服务器的情况下获得访问令牌。我们让它变得相当简单。查看文档

在 android 上相当容易 https://developers.google.com/identity/sign-in/android/additional-scopes

https://developers.google.com/identity/sign-in/ios/ https://developers.google.com/identity/sign-in/ios/additional-scopes

网络 https://developers.google.com/identity/sign-in/web/incremental-auth

您可以更改所需的范围。

我猜当你说你没有服务器时,你的应用程序是本机应用程序。例如桌面应用程序或嵌入式应用程序。如果是这样,您可以使用 OAUth 游乐场生成令牌。有关详细信息,请参阅 How do I authorise an app (web or installed) without user intervention? (canonical ?)