通过REST API读取其他用户的Google Fit数据 [英] Reading other user's Google Fit data via REST API
问题描述
我们有一个用户同意我们的Cloud Project通过Android应用读取其Fit数据.现在,我们希望用户的教练通过与我们的Cloud Project关联的Web UI访问其Fit数据.这可能吗?如果可以,那么正确的方法是什么?
We have a user who gave consent for our Cloud Project to read their Fit data through the Android app. We now want user's coach to access their Fit data through a web UI associated with our Cloud Project. Is this possible, and if so, what is the right way to do it?
可以使用跨客户身份吗? https://developers.google.com/identity/protocols/CrossClientAuth
Can cross-client identity be used? https://developers.google.com/identity/protocols/CrossClientAuth
我试图在REST端点中将我"替换为"user@gmail.com",但它不起作用: https://www.googleapis.com/fitness/v1/users/me/ ...-> https://www.googleapis.com/fitness/v1/users/user@gmail.com/ ...
I was trying to replace "me" with "user@gmail.com" in the REST endpoint but it doesn't work: https://www.googleapis.com/fitness/v1/users/me/... -> https://www.googleapis.com/fitness/v1/users/user@gmail.com/...
谢谢!
推荐答案
CrossClientAuth指南中针对您的问题提供了一种机制,供Android应用获取对Web后端的脱机访问.通过脱机访问,理论上您可以以用户同意的任何方式提供或存储该数据.您必须自己处理对他人的数据访问控制.
There is a mechanism for Android apps to obtain offline access for web back-ends highlighted in the CrossClientAuth guide from your question. With offline access, you can theoretically serve or store that data in any way that the user has consented to. Any access controls of that data to another person is something that you'd have to handle on your own.
这篇关于通过REST API读取其他用户的Google Fit数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!