我使用django- REST -framework在django中实现了rest api,并使用oauth2进行身份验证。
我使用以下工具进行测试:
curl -X POST -d "client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&grant_type=password&username=YOUR_USERNAME&password=YOUR_PASSWORD" http://localhost:8000/oauth2/access_token/
和
curl -H "Authorization: Bearer <your-access-token>" http://localhost:8000/api/
在localhost上,成功的结果与文档一致。
在将其推送到现有的AWS弹性beanstalk实例时,我收到以下消息:
{ "detail" : "Authentication credentials were not provided." }
https://stackoverflow.com/questions/22279301
复制相似问题