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
This project is an API Rest that provides an authentication service using JWT tokens.
You need the following components to use the projet, please make sure you have installed them :
- Clone the repo.
git clone https://github.com/Alessandro-AP/JWTAuthentication.git
- 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.
- 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.)
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:
- 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)
- 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)
Alessandro Parrino
Daniel Sciarra
Marco Maziero
Gaétan Zwick
Anh Mai Hoang
Project Link: https://github.com/Alessandro-AP/JWTAuthentication
Distributed under the MIT License. See LICENSE.txt
for more information.