Skip to content

Vasseurr/Spring-Security-with-JWT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Authentication and authorization with Json Web Token

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages