iamprafful / rest-api-authentication-tutorial

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

Home Page:https://prafful.hashnode.dev/spring-boot-rest-api-authentication-best-practices-using-jwt-2022

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

https://prafful.hashnode.dev/spring-boot-rest-api-authentication-best-practices-using-jwt-2022


Languages

Language:Java 100.0%