Search code examples
djangoapioauthoauth-2.0tastypie

How do I create a user using OAuth2?


I am using Django with a Tastypie library, and the Django-OAuth-Toolkit, and a Tastypie authentication for the Django-OAuth-Toolkit.

Disclaimer: There is a chance I am totally wrong about all of this. If so, please correct me and guide me towards the less ignorant.

Main Question: How do I create users securely?

My Understanding:

  • In order to get or post, the client needs a token.
  • In order to get a token, they need to login.
  • In order to login they need a user account.
  • In order to make an account they need token.
  • In order to make an account they need to login?

I am left in a struggle trying to figure this out. Do I make it when the client tries to make an account it does not need OAuth2? Or is there a way to use OAuth2 without a login that only lets the client create accounts?

Any help is much appreciated!


Solution

  • in order to make an account you don't need a token, Signup using the normal flow, and on login request authenticate the user and give the token for further communication.