Authorization Credentials Stripped — django, elastic beanstalk, oauth

后端 未结 4 1130
无人及你
无人及你 2020-12-02 07:31

I implemented a REST api in django with django-rest-framework and used oauth2 for authentication.

I tested with:

curl -X POST -d \"client_id=YOUR_CLI         


        
4条回答
  •  温柔的废话
    2020-12-02 08:02

    Though the above solution is interesting, there is another way. Keep the wsgi.conf VirtualHost configuration file you want to use in .ebextensions, and overwrite it in a post deploy hook (you can't do this pre-deploy because it will get re-generated (yes, I found this out the hard way). If you do this, to reboot, make sure to use the supervisorctl program to restart so as to get all your environment variables set properly. (I found this out the hard way as well.)

    cp /tmp/wsgi.conf /etc/httpd/conf.d/wsgi.conf
     /usr/local/bin/supervisorctl -c /opt/python/etc/supervisord.conf restart httpd
    exit 0
    

    01_python.config:

    05_fixwsgiauth:
        command: "cp .ebextensions/wsgi.conf /tmp"
    

提交回复
热议问题