android - Use Google Drive API without user's private information
问题描述
I want to upload a file to a user's Drive. I have an Android application backed by a web server, so I can either upload the file directly from the device or have my backend do it.
I don't want access to identifiable information. Privacy is important for my users, and I don't want them to consent to giving me their profile. I don't need it and won't use it.
How can I remove the user's profile from the scope of my token?
In Android code, for my GoogleSignInOptions
I'm deliberately NOT using the default scopes, which include profile info. This was my attempt when trying to use my backend:
val options = GoogleSignInOptions.Builder()
.requestScopes(Scope(Scopes.DRIVE_FILE)) // only my own app's files
.requestIdToken("<my app id>")
.build()
Removing the requestIdToken
without including requestEmail
causes the flow to fail, because no token or ID is returned at all.
解决方案
推荐阅读
- python - 由 matplotlib 中的点确定的轮廓边缘
- java - Android 相对布局按钮使应用程序崩溃
- java - Netty systemd 延迟初始化
- java - maven 依赖:purge-local-repository 导致依赖解析错误
- c++ - 方括号运算符[]的输入输出方法
- javascript - 请求的资源上不存在“Access-Control-Allow-Origin”标头 - 角度 5
- jenkins - 使用来自 SCM 的 Jenkinsfile 进行 Jenkins 参数化构建
- javascript - 如何关闭使用 document.createElement 创建的 HTML 标签?
- pester - 如何使用 Pester 模拟模块不可用的 cmdlet?
- wordpress - 购买相关变体时,Woocommerce 以编程方式减少库存