Code Monkey home page Code Monkey logo

authapiclient's Introduction

JWT Authentication Web Client

This project is a web client that consumes the JWT Authentication API implemented using Django Rest Framework. It allows users to interact with the API for authentication, token management, and secure communication.

Features

  • User-friendly interface for registration, login, and token management.
  • Automatic token validation and refreshing.
  • Prompt for re-login when both tokens are expired.
  • Interacts with the JWT Authentication API endpoints.

Installation and Setup

  1. Clone the repository:
    git clone https://github.com/yourusername/your-authentication-web-client.git
    cd your-authentication-web-client
    
  2. Serving the client Inside a terminal, run the command
    python -m http.server 8001
    it is specific to 8001 because this address is accepted in the AuthenticationAPI's CORS_ALLOWED_ORIGINS. this can be modified to your desire. Open the client.html file in a browser on port 8001

Usage

  • Once the page loads, the client will attempt to fetch the access token from localStorage. If its not there, you will be prompted to login.
  • Once its retrieved from the server, you will be forwarded to the authenticated page where you will be shown a message from the server. this can as well be customized to your desire.
  • Token verification and refresh are automatically handled by the client and when both tokens are expired, you will be prompted to login again.

Security Considerations

Storage: Tokens are stored in the browser's local storage for this demo. In a production environment, consider using more secure methods such as HttpOnly cookies for storing tokens

authapiclient's People

Contributors

edgarmuyomba avatar

Stargazers

 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.