获取持久令牌以访问Google域下的用户数据
我正在尝试实施 Google APPs Marketplace 应用程序。该应用程序的某些部分是基于网络的,而其他部分只需要离线访问用户数据。
在安装过程中,Google 域管理员授予对应用程序所需数据(例如日历)的访问权限。
对于应用程序的基于Web的部分,用户使用OpenID+OAuth,因此应用程序可以访问用户的数据(这工作正常)。
问题:
- 离线部分访问用户数据的最佳实践应该是什么?
- 我是否必须为域中的每个用户存储持久访问令牌?
- 我是否可以避免每个用户授予对其数据的访问权限(在域管理员已经在域级别完成此操作之后)?
- 有没有办法从后台应用程序利用 OpenId?
I am trying to implement a Google APPs Marketplace application. Some parts of the application are web-based and other parts simply need offline access to users data.
During installation, the Google domain administrator grants access to the data required by the application (e.g Calendar).
For the web-based part of the application, users use OpenID+OAuth, so the application can access the user's data (this works fine).
Questions:
- What should be the best practice for the offline part to gain access to users data ?
- Do I have to store a persistent access token for EACH user in the domain ?
- Can I avoid the need for each user to grant access to their data (after domain administrator has already done this at the domain level) ?
- Is there a way to utilize OpenId from a background application ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因为 Sean M 事实上回答了你的问题。 4 与他的评论,我将处理其他三个:
您可以使用 2 足 oAuth。使用 2-legged oAuth,应用程序可以访问在安装过程中授予它的服务和数据(例如对日历的读/写访问权限),而无需用户的任何额外批准。
在 2-legged oAuth 中,没有令牌。相反,该应用程序提供了 oAuth 密钥和密钥,并使用它们来访问 Google 服务并读取/写入数据。
更多阅读:
http://code.google.com/intl/cs /googleapps/marketplace/tutorial_java.html#Integrate-OAuth
Since Sean M in fact answered you to the question no. 4 with his comment, I will handle other three:
You can use 2-legged oAuth. Using 2-legged oAuth, application can access services and data that were granted to it during installation process (for example Read/Write access to Calendar) without any additional approval from user.
In 2-legged oAuth there are no tokens. Instead, the app is provided with oAuth key and secret and uses these to access Google services and read/write data.
More reading:
http://code.google.com/intl/cs/googleapps/marketplace/tutorial_java.html#Integrate-OAuth