Authorization Credentials Stripped — django, elastic beanstalk, oauth

后端 未结 4 1137
无人及你
无人及你 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条回答
  •  旧时难觅i
    2020-12-02 08:09

    I thought the problem was with my configuration in django or some other error type instead of focusing on the differences between localhost and EB. The issue is with EB's Apache settings.

    WSGIPassAuthorization is natively set to OFF, so it must be turned ON. This can be done in your *.config file in your .ebextensions folder with the following command added:

    container_commands:
      01_wsgipass:
        command: 'echo "WSGIPassAuthorization On" >> ../wsgi.conf'
    

    Please let me know if I missed something or if there is a better way I should be looking at the problem. I could not find anything specifically about this anywhere on the web and thought this might save somebody hours of troubleshooting then feeling foolish.

提交回复
热议问题