Skip to content

Alessandro-AP/JWTAuthentication

Repository files navigation

JWTAuthentication

JWTAuthentication is a JWT based authentication micro service developped with Spring. It is part of a school practical project that aims to extend our skills on web app development and team work.
Explore the wiki »

Main project can be found here : https://github.com/Ga-3tan/AMT_Project

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact
  5. License

About The Project

This project is an API Rest that provides an authentication service using JWT tokens.

Built With

Getting Started

Prerequisites

You need the following components to use the projet, please make sure you have installed them :

Installation

  1. Clone the repo.
git clone https://github.com/Alessandro-AP/JWTAuthentication.git
  1. Open a terminal in the same location as the pom.xml and enter the command:
mvn clean install

This command will clean up the target/ folder and perform the install cycle (validate, compile, test, package, verify) in order to create a .jar artefact in the target/ folder.

  1. In the same directory as before, enter the command:
docker-compose up -d

The docker-compose.yml lets you bring up a complete docker development environment, it will install two main services:

springboot-auth : Spring Boot REST API which runs on port 8084.
mysql-auth : MySQL DB which runs on port 3306

(Warning: make sure these ports are free, otherwise change them in the docker-compose.yml)
(Warning: Make sure that "mysql container" and "spring boot container" are both running because if the spring boot container starts before the mysql container is properly started the spring boot container will not start. In that case you will need to restart manually the spring boot container.)

Usage

Documentation swagger https://app.swaggerhub.com/apis-docs/gaetan.zwick/Authentication-MIcroservice/v1

You can change the encryption key of the JWT token in the file CustomAuthenticationFilter

Once the application has been launched, two actions are possible:

  1. Register: A user can register at the endpoint /register by sending an HTTP POST request containing a JSON body with a username and a password (see the example below)

register

  1. Login : A user can login to the /login endpoint by sending an HTTP POST request containing a JSON body with a username and a password (see the example below)

login


Contact

Alessandro Parrino
Daniel Sciarra
Marco Maziero
Gaétan Zwick
Anh Mai Hoang

Project Link: https://github.com/Alessandro-AP/JWTAuthentication

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages