mcueto / djangorestframework-auth0_sample

Sample Django project for djangorestframework-auth0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

create user after they authenticate using auth0

saius opened this issue · comments

commented

Hello
I trouble with creating user in my django api database after their authenticate using AUth0.
actually, I need to store user because they are associated to others models in my rest api
Please how could your package help me.
I use in frontend angular 2
backend: django rest framework

thanks

when you send the token generated by auth0 using djangjorestframework-auth0, the package will create the user for you(only if the token is valid obviously)

commented

@saius you can manage your users(backend users) directly in django manage!, just register the Django User model to the admin.py file, then you can create any user you want. BUT, i strongly recommend to use auth0 users as they're meant to be used:

  • create the user in the auth0 dashboard and when the user login in your frontend then send the Authorization header to the endpoint.

Now: if you wanna create Auth0 users within inside the app, you can't. in that case you'll need to implement the Auth0 management api in your frontend.

commented

You're implementing your own way to decode jwt in your app, i recommend you (if you're using auth0) to use djangorestframework-auth0 instead of that

@saius, please let me know if you figured out how to put djangorestframework_auth0 and angular2 to work together, meanwhile, i close this issue