Giter VIP home page Giter VIP logo

jwt_login's Introduction

Curious about how ๐—๐—ช๐—ง ๐—”๐˜‚๐˜๐—ต๐—ฒ๐—ป๐˜๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป + ๐—ฆ๐—ฝ๐—ฟ๐—ถ๐—ป๐—ด ๐—ฆ๐—ฒ๐—ฐ๐˜‚๐—ฟ๐—ถ๐˜๐˜† works?

It's a three step process:

โ€ข Client hits a requests , which gets authenticated and a JWT token gets created using spring security prebuild encryptor and library along with some of our manual configs.

โ€ข Once JWT tokens (acces_token + refresh_token ) gets created they are send back to the UI which persist those tokens somewhere locally on client or preferably on servers.

โ€ข Then UI hits backs the request along with JWT token, and gets successfully served with the required API response.

This happens in fraction of time that it's not noticable to user.

These 2 above specified tokens namely access_token and refresh_token has limited lifespans , which is encrypted in the token itself.

lifespan of access_token<<refresh_token

Once access_token gets expired it(UI) requests for new access_token to backend using refresh_token.

Refresh_token too have limited lifespan typically around a month or year as per need.

Once refresh_token gets expired , used is asked to relogin to the system hence following the above lifecycle again and again.

Wanna checkout how actual code of it using spring security looks like??

Then checkout my below Github repository:

jwt_login's People

Contributors

shubhamharitash 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.