Friday, October 11, 2024

jwt authentication in ninja without django user

Hello.

This seems very complex to me.

I have previously used other Python and non-Python frameworks and one thing I always did is to create my own user table and respective model.

I wish to do the same thing in django with ninja.

I also find the jwt authentication articles/ blogs online very complex.

Can some one guide me to a simple explanation?

My requirement is very simple.

I have an accounts table with all user data including username and password.

The user creates this during registration, I don't want to use the django user model.

Now every time the user logs in, I wish to generate the token and with every request I need to authentication.

I know that in the router.get or router.post decorator I will have to inject the authentication function.

But no tutorial gives a clear indication of where to create this class and no simple code to just authenticate and go ahead.

I am trying to use simplejwt from rest_framework.

If this is not the correct way please guide.

Regards.

--
Email Signature
Krishnakant Mane
Software Architecture Design & Implementation Specialist

Mobile:
+91 8424039903
https://www.linkedin.com/in/krishnakant-r-mane/

No comments:

Post a Comment