A fast, lightweight, and secure authentication service built using Java Spring Boot, MySQL, and Docker
Ideal for developers who want a quick and secure way to implement user authentication in their apps. With Docker containerization, this service is also easily deployable and scalable for modern applications.
- Java 17 (Spring Boot)
- MySQL (Database)
- Docker (Containerization)
- Docker: Make sure Docker is installed and running.
- MySQL: MySQL should be configured (will run in a Docker container).
git clone https://github.com/your-username/simple-auth-service.git cd simple-auth-service
- Build the Docker container:
docker-compose build
- Start the application:
docker-compose up -d
- The app will now be accessible on
http://localhost:8080.
- The MySQL database will run in a Docker container and will be automatically configured on startup.
- You can access the MySQL database on
localhost:3306with the credentials set in thedocker-compose.ymlfile.
Register a new user.
Request Body:
{ "usrname": "username", "password": "strongPassword123", "name": "Your Name" }
Login to receive a Token.
Request Body:
{ "username": "username", "password": "strongPassword123" }
Update the current authenticated user
Headers:
X-API-TOKEN: Token
Request Body:
{ "username": "username", "password": "strongPassword123", "name": "Your Name" }
Get the current authenticated user's details.
Headers:
X-API-TOKEN: Token
Logout and invalidate the token.
Headers:
X-API-TOKEN: Token