Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New user Registration & Authentication on Android app with django Backend

I wish to implement a registration (and then authentication) for a new user who uses my android app. A django based framework is sitting on the back-end.

The workflow is the same as any other app:

  • User signs up.
  • User logs in using the credentials. (or user may use FB/ Google login directly)
  • User proceeds to main app.

From the backend, it is required for user to be authenticated(logged in) to use most of the functionality. Moreover, a decent level of security is also a requirement. From the django side, this task is fairly easy for HTML pages due to built in registration views and decorators. However, my question is how to implement this for android. I am in total fix regarding the workflow of the entire system.

From what I've searched on internet, people suggest two things as solution to this:

  1. Develop on HTML and use android's webview for this entire thing.
  2. Use POST request to send User ID & Passwd to backend. The workflow after that is unclear to me since I can't use django's inbuilt system with it (CSRF protection, auth etc.)

Now the problem is that I have not implemented any website for the application, and I am more comfortable doing it on mobile app. I have gone through numerous tutorials on auth, outh and REST packages of django, but all of them seem to be tailored for webapp.

My question is: What is the mot suitable flow considering app has to be for professional use ?

like image 401
silent_grave Avatar asked Jan 12 '15 21:01

silent_grave


People also ask

What is new registered user?

Going through New User Registration, the user can either create a user ID and password, or use an existing user ID to sign in to your system. New User Registration assigns the newly created user profile with generic security roles that are required to access your system.

What is user registration system?

User registration systems are screens, forms, or profile pages that request information from a user to create a web-based account or profile. A user registration system generally asks a user to create a username and password, and possibly answer other security questions as well.


2 Answers

You can build REST API for django signin/registration process.

One of the packages that can help you with that is https://github.com/sunscrapers/djoser

like image 83
kmmbvnr Avatar answered Oct 12 '22 21:10

kmmbvnr


I ended up using REST framework for Django with Token Authentication.

like image 21
silent_grave Avatar answered Oct 12 '22 20:10

silent_grave