Django Tutorial: Building and Securing Web Applications

I had to add the following to the class Auth0 (auth0.py) to avoid self-signed certificate error.
I think it’s also important to mention that self.setting(‘DOMAIN’) and self.setting(‘KEY’) do not have to be modified

import ssl

ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
id_token = response.get(‘id_token’)
jwks = request.urlopen(‘https://’ + self.setting(‘DOMAIN’) + ‘/.well-known/jwks.json’, context=ctx)

1 Like