Authentication is essential for securing your API endpoints, and Djuix provides a robust system to manage user authentication through JSON Web Tokens (JWT). The authentication system is designed to be both powerful and user-friendly, allowing you to set up secure endpoints with minimal configuration.This documentation outlines how to set up and use the Auth plugin in Djuix to protect your API.
30
for a 30-minute expiration.7
for a 7-day validity.After defining the fields, the Auth Manager will manage user creation using Django’s built-in BaseUserManager
. This includes:
Creating a standard user.
Creating a superuser with elevated privileges.
Utilize Django's AbstractBaseUser
and PermissionsMixin
to define your custom user model.
Implement the CustomAuthManager
for managing user authentication and permissions.
The inclusion of JWTs is handled within the Djuix.io system. The tokens can be used to authenticate users by including them in the Authorization header as a Bearer token.
When a user successfully authenticates, they receive an access token and a refresh token.
Authorization
header of subsequent requests:Authorization: Bearer <access_token>
Note: Depending on your project's requirements, Djuix can automatically create an Auth profile when you set up a project using the AI project creation.
Djuix's authentication system provides a secure, flexible, and easy-to-implement solution for protecting your API endpoints. By leveraging JWT and providing an intuitive configuration interface, Djuix ensures that you can focus on building your API's core functionality while maintaining robust security practices.
Remember to regularly review and update your authentication settings, especially token expiry times, to maintain the security of your application.