Skip to content

achalpathak/jwt-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Version Requirements

Description

Built token-based authentication library for authenticating users. Used HSA256 algorithm for token generation. Created proper API documentation using Swagger/ReDoc.

Configure Settings

# Configure JWT Settings
JWT_CONFIGURATION = {
    'TOKEN_LIFETIME': timedelta(days=7), #token expiry in 7days
    'UPDATE_LAST_LOGIN': True,
    
    'ALGORITHM': 'HS256',
    'SIGNING_KEY': SECRET_KEY,
    
    'AUTH_HEADER':'Bearer',
    'AUTH_HEADER_NAME': 'HTTP_AUTHORIZATION',
}

# Specify User model for authentication
AUTH_USER_MODEL = 'userAuth.User'

Usage

class UserProfileAPI(RetrieveAPIView):
    permission_classes = [custom_permissions.IsTokenVerified]
    def get(self, request):
        pass

About

JWT Based Authentication Library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages