简体   繁体   中英

How to prevent bots using REST API calls to register new users from an mobile app?

I want to write a backend application with REST API in django-tastypie for mobile apps.

If i am sending POST data (user-object) to eg http://localhost:8000/api/v1/register/ from within my mobile app to register a new user, everybody who knows the url can register new users and blow my database. How do i prevent this? Is using a REST-API for user registration a wrong approach? Can someone point me to in the right direction? I dont want to use OAuth for logging in my users.

everything depends on how securely you can store data on the mobile application...

if you are pretty sure that you can have something securely stored on the mobile phones with your app, the simplest solution is to set-up certificate authentication on your frontend server, in such a case every connection without proper certificate will fail

this is quite simple solution that does not require any changes to your backend code, only small change to clients (to use certificate)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM