0
votes

I followed the tutorial on auth0 https://auth0.com/docs/quickstart/webapp/django/ and was able to get a webpage that allows for user creation based on auth0 authentication. It uses social_core.backends.oauth with a middle layer that processes some of the authentication.

I've also set up a test for my google home action device that sends an action.devices.SYNC via webhook and it gives me an authorization/bearer key that I should use to send to auth0 to retrieve userinfo that will allow me to access this bearer's account information, so that I can use the email address to access additional info in my server for smart home actions.

I see that in the example, by the time it gets to:

def dashboard(request):
    user = request.user
    auth0user = user.social_auth.get(provider='auth0')

that request has a user object that lets me retrieve additional information on the user.

How do I do the same thing with my webhook? It does not have a user object, but I'm not sure how to patch that into my existing webhook handler, it uses:

class frontEndConsumer(AsyncHttpConsumer):
    async def http_request(self, request):
    # processes request object, extracts header and body, etc
1

1 Answers

1
votes

i was able to use https://auth0.com/docs/quickstart/backend/python/02-using#obtaining-an-access-token

with modifications so it works with HTTPS connection, i was able to get it to work.