Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 1.9 KB

File metadata and controls

60 lines (47 loc) · 1.9 KB

SpringBoot JWT Authentication

This Repository is used for references in the sector of JWT Security.

Setup

Pre-Requisites :

  • Java version - 17
  • Spring Boot Packages
  • Maven 3.6 or higher.
  • Sql Workbench

Spring Dependencies :

  • Spring Boot Starters
  • JSON Web Token
  • Spring Security
  • Spring Configuration Processor
  • Spring Boot Test

Installation

  • Clone the Repository

    git clone https://github.com/lgsurith/spring-auth-ref.git
    cd spring-auth-ref
  • Configure MySql Database in application.properties

    spring.application.name=authapi
    spring.datasource.url = jdbc:mysql://localhost:3306/employee_auth
    spring.datasource.username = username
    spring.datasource.password= password
    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
    spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
  • Build the Project

    mvn clean install
  • Run the Springboot Application

    mvn spring-boot:run

    The Application will start in http://localhost:8080

API Endpoints

Endpoint Description
/api/auth/signup Initial user signup without authentication.
/api/auth/login Obtain the token while logging in, which will be used for authentication by passing it in the bearer token.
/api/user/me Gets the particular user's information after authentication.
/api/user/ Gets all the users from the database.

Video Walkthrough :

reference_video.mp4