如何在Google应用程序域中模拟GoogleCredential? [英] How to impersonate a GoogleCredential in a google apps domain?

查看:261
本文介绍了如何在Google应用程序域中模拟GoogleCredential?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个应用程序,让管理员可以管理谷歌应用程序域中的用户文件。
由于docList api已被弃用,我使用了Drive api。

如何在登录后以其他用户的身份创建云端硬盘服务作为管理员?



有人建议使用OAuth使用者密钥。



但我不知道如何使用oauth-2.0来实现此功能。 解决方案您可能想看看这篇文章: Google云端硬盘服务帐户返回403个使用限制



我使用OAuth2和一个服务帐户来完成大致相同的操作。请记住,您需要使用API​​控制台来设置您的环境,并确保已将服务帐户添加到Google Apps域,并使用合适的范围允许访问。


I'm making an application wich allows the admin to manage the files of users in the google apps domain. Since the docList api is deprecated I used the Drive api.

How I can create a Drive service as another user while logged in as admin?

Some people suggested to use the OAuth consumer key.

But I don't know how to implement this with oauth-2.0.

解决方案

You might want to check out this post: Google Drive service account returns 403 usageLimits

I used OAuth2 and a service account to accomplish pretty much the same. Keep in mind you need to use the API Console to setup your environment and ensure the service account is added to the Google Apps domain with the proper scopes to allow access.

这篇关于如何在Google应用程序域中模拟GoogleCredential?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆