相关疑难解决方法(0)

什么是基于令牌的身份验证

我想了解基于令牌的身份验证的含义.我搜索了互联网,但找不到任何可以理解的东西.

security authentication token http-token-authentication

489
推荐指数
7
解决办法
37万
查看次数

Django Tastypie:如何使用API​​密钥进行身份验证

我正在使用TastyPie制作内部API.我有

from tastypie.authentication import ApiKeyAuthentication
class MyResource(ModelResource):
  Meta:
    authentication = ApiKeyAuthentication()
Run Code Online (Sandbox Code Playgroud)

禁用Auth规则后,我的API运行良好.有了它,无论我尝试什么,我都会收到401(未经授权)的回复.

我确信这是一旦你看到它在行动中非常明显的事情之一,但在此期间,请告知如何提出请求(GET).

python django tastypie

14
推荐指数
1
解决办法
1万
查看次数

Tastypie APIKey身份验证

Tastypie APIKey身份验证如何工作?我知道文档中提到了一个信号:

from django.contrib.auth.models import User    
from django.db import models  
from tastypie.models import create_api_key 

models.signals.post_save.connect(create_api_key, sender=User)
Run Code Online (Sandbox Code Playgroud)

但是,什么时候被称为?如果我想向用户提供他们的API密钥,我知道我可以在APIKey数据库中找到这个create_api_key函数添加密钥,但是在何时何地调用此models.signals.post_save函数?

这只是另一款django型号吗?我觉得是这样的?

每次保存用户帐户时都会调用此命令吗?

django api-key tastypie

12
推荐指数
1
解决办法
6570
查看次数