已安装 stormpath 并使用 google 登录来注册和登录。 现在我正在尝试使用这个在 stormpath 的 google 目录中创建组
from stormpath.client import Client
stormpath_client = Client(id=STORMPATH_CLIENT_APIKEY_ID, secret=STORMPATH_CLIENT_APIKEY_SECRET)
directory = stormpath_client.applications[0].account_store_mappings[1].account_store
directory.groups.create({'name': 'admins'})
我得到了错误
Cannot create nor edit accounts of externally managed directories.
如果我尝试在 stormpath 控制台中创建组,我会遇到同样的错误。
如何给不同的用户不同的权限?
最佳答案
Stormpath 不允许您为社交目录(如此处的 Google 目录)创建群组。
你需要做的是创建一个普通的 Stormpath 目录(不是社交目录),在那里创建你的用户,然后你可以做一些事情,比如创建组等。
我(个人)喜欢做的是:
- 用户通过 Google 登录后,我将在我的主 Stormpath 目录中创建该用户帐户的副本。
- 然后我将在 Stormpath 目录中使用该用户的副本作为该用户的“主”帐户,并在那里创建组等。
关于python - stormpath 无法为谷歌登录目录创建组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35014832/