Skip to content

This repository is made to share source code of my blog post where I have explained how to do token based authentication for your Spring boot REST API using JSON web tokens(JWT).

Notifications You must be signed in to change notification settings

iamprafful/rest-api-authentication-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner.png

Spring Boot REST API authentication best practices using JWT

Token based API authentication with Spring Security and JWT (JSON web Token)

Overview

This repository is made to share source code of my blog post Spring Boot + JWT where I have explained how to do token based authentication for your Spring boot REST API using JSON web tokens(JWT).

Output

  • Handling unauthorized access to protected routes with error 401:

image.png

  • Get token in response of register request

image.png

  • Invalid credentials response when wrong username password is supplied:

image.png

  • Show content from protected route when Auth token is provided in header.

image.png

About

This repository is made to share source code of my blog post where I have explained how to do token based authentication for your Spring boot REST API using JSON web tokens(JWT).

Topics

Resources

Stars

Watchers

Forks

Languages