GithubHelp home page GithubHelp logo

jdcarvalho / drfauth Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 70 KB

POC: Discover the power of Django Rest Framework API with custom expiring authentication.

License: MIT License

Python 80.56% HTML 19.44%

drfauth's Introduction

Custom Expiring Access Tokens with Django and Django Rest Framework

This repository contains a proof of concept implementation for generating custom expiring access tokens using Django and Django Rest Framework.

Overview

In many web applications, it's crucial to manage user authentication and access securely. Traditional access tokens might not suffice for scenarios where you need tighter control over the lifespan of access tokens. This proof of concept demonstrates how to implement custom expiring access tokens using Django and Django Rest Framework.

Features

  • Custom Expiring Tokens: Instead of using traditional tokens, this implementation generates custom expiring tokens.
  • Token Expiry Management: Tokens have a predetermined expiration time, enhancing security and reducing the risk of unauthorized access.
  • Django Rest Framework Integration: The proof of concept leverages Django Rest Framework for API development, making it easy to implement token-based authentication.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Special thanks to the Django and Django Rest Framework communities for their excellent documentation and resources.

Testing this project

Create a new environment for the project (all fixtures will be loaded post migrate)

python3.x -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade wheel
pip install -r requirements.txt

Make migrations, migrate and then create a new superuser:

./manage.py makemigrations
./manage.py migrate
./manage.py createsuperuser

Run the application then login

./manage.py runserver

Use cURL, Postman or python-requests to test the API

Image

drfauth's People

Contributors

jdcarvalho avatar

Stargazers

 avatar jesusenlanet avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.