Giter Site home page Giter Site logo

Comments (5)

MitchSRobinson avatar MitchSRobinson commented on July 3, 2024

Hi there,

I think I'm stuck in the same problem as you were - did you manage to find a solution?

Currently the only response I get is "Incorrect authentication credentials." so could really do with some assistance.

Thanks

from auth0-django-api.

xcdr avatar xcdr commented on July 3, 2024

Hi,

I have the same problem, I get is "Incorrect authentication credentials." and don't know how to create valid django user (I created user with the same username as auth0 user_id with replaced '|' by '.').

UPDATE: I added print(f"DEBUG: username={username}") to jwt_get_username_from_payload_handler() and never seen this message, I suppose handler is not called.

from auth0-django-api.

zrev2220 avatar zrev2220 commented on July 3, 2024

Has anyone figured out a solution?

I'm confused on this step too. The Auth0 docs and the Django docs are not clear as to whether I simply create a normal Django user and mentally declare it the "remote user," or if there's some other special procedure to follow.

from auth0-django-api.

speedy250 avatar speedy250 commented on July 3, 2024

It's not super clear anywhere, but it becomes clearer if you change the code to this:

from django.contrib.auth import authenticate

def jwt_get_username_from_payload_handler(payload):
  username = payload.get('sub').replace('|', '.')
  user = authenticate(remote_user=username)
  print('user', user, payload)
  return username

Django has actually created a User that has no password where the username comes from the auth0 normalized dataset. If you do a search in Users table on the username that is returned you'll find a blank User object! You can then modify the User however you need.

The Auth0 docs shouldn't say Then create a remote user in Django authentication system because it a remote user is already created.

from auth0-django-api.

stale avatar stale commented on July 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

from auth0-django-api.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.