GithubHelp home page GithubHelp logo

vasseurr / spring-security-with-jwt Goto Github PK

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

Authentication and authorization with Json Web Token

Java 100.00%
spring-boot spring-security jwt-authentication jwt-token

spring-security-with-jwt's Introduction

Hello, folks!

My name is Okan and I'm a student of Computer Engineer. You can find me on LinkedIn.

System includes:

  • JWT with Spring Security
  • Registration and Login
  • API
  • Private and protected resources

API Methods

  • POST /api/auth/signup for signup new account
  • POST /api/auth/signin for login an account
  • GET /api/test/all for retrieve public content
  • GET /api/test/user for access User's content
  • GET /api/test/mod for access Moderator's content
  • GET /api/test/admin for access Admin's content

๐Ÿ”ง Technologies & Tools

About System

Tables that we define in entites package will be automatically generated in database.

We also need to add some rows into roles table before assigning any role to User.

We can register with /signup API

  • admin with ROLE_ADMIN
  • mod with ROLE_MODERATOR
  • user with ROLE_USER

After registration operation, our tables could look like this.

We have public and protected resources.

Public resource

  • /api/test/all

Protected resources

  • /api/test/user
  • /api/test/mod
  • /api/test/admin

We need sign in to access protected resources.

POST /api/auth/signin

After signing in, we can access resources with token and its type depends on our roles.

We have no permission to access admin content, so we need sign in with admin account.

After signing in, we can access admin content.

๐Ÿ“ˆ GitHub Stats

Top Langs

Okan's GitHub stats

Readme Card

Readme Card

spring-security-with-jwt's People

Contributors

vasseurr avatar

Stargazers

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