Testing flask-oauthlib locally without https

后端 未结 3 1444
清酒与你
清酒与你 2021-02-01 01:36

I have implemented an oauth2 server and an oauth2 client using flask-oauthlib.

When I am trying to test locally, the client returns an InsecureTransportError and tells

3条回答
  •  情书的邮戳
    2021-02-01 02:23

    For OAuth1 you can add setting

    app.config.update({
        'OAUTH1_PROVIDER_ENFORCE_SSL': False
    })
    

    For OAuth2 you can setting in environment variable.

    export OAUTHLIB_INSECURE_TRANSPORT=1
    

    or in runtime

    import os
    os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
    

提交回复
热议问题