Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 710
Tsangares Avatar asked Oct 27 '25 10:10

Tsangares


2 Answers

The answer is No, OAuth2 is usually meant for authorisation which in turn needs authentication.

So for creating account you cannot use Oauth, you have to use normal flow , setup account and then you can use OAuth to gain access token.

like image 121
Ramesh Lingappa Avatar answered Oct 30 '25 03:10

Ramesh Lingappa


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.

like image 44
doubleo46 Avatar answered Oct 30 '25 04:10

doubleo46



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!