简体   繁体   English

如何使用每个帐户(而非用户)具有API密钥的Django Rest框架?

[英]How do I use an Django Rest Framework with API key per account (not user)?

For Django, both tastypie and django-rest-framework seem to be focused on API authentication/authorization/throttling per user. 对于Django而言,iciouspie和django-rest-framework似乎都专注于每个用户的API身份验证/授权/限制。 I want to expose an API that is per account, where an account might have multiple users administrating it. 我想公开一个针对每个帐户的API,其中一个帐户可能有多个用户对其进行管理。 What is the best way to approach this problem? 解决此问题的最佳方法是什么?

The django-rest-framework can achieve this. django-rest-framework可以实现这一目标。 You don't have to throttling a user, these are options. 您不必限制用户,这些都是选择。 You could have Basic Authentication for one account (username and password) that multiple user have access to. 您可以对多个用户可以访问的一个帐户(用户名和密码)进行基本身份验证

You have Custom Authentication will any manner of options. 您具有“ 自定义身份验证”的任何方式的选项。 Digest Authentication and much more. 摘要式身份验证等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM