Home > Blockchain >  More than two custom params to generate Token in Django RF
More than two custom params to generate Token in Django RF

Time:03-11

I'm a frontend mobile developer, i have a Flutter project 100% white labeled, now i'm studying the backend and developing it with Django RF. I'll use the same database for all generated builds of my app, so to prevent the user to login with the same account in two differents builds, i need to generate a Token with more than 2 parameters (email/password a third one). What's the best practice in this case?

I'm using the 'rest_framework.authentication.TokenAuthentication'.

CodePudding user response:

"Consider this answer as a comment. I can not comment(lack of reputation)."
About 'rest_framework.authentication.TokenAuthentication', as far as I realized from docs, it takes a user object(not some specific fields) and makes a hash, and it does not made any description about customize it. The other solution is using JWT, and DRF simplejwt. and by using that you can customize which fields to make hash according to Customizing token claims.

  • Related