This project implements the OAuth2 authentication from the 42 school platform in Spring Boot. Using technologies like Java, Spring Boot, and Spring Security, the project enables users to authenticate with their 42 credentials and access profile information. It provides an easy and secure way to integrate 42 authentication into Spring applications.
This project is heavily inspired in Belnut implementation.
- Java 20 - Java SE Development Kit 20
- Spring Boot - Framework to ease the bootstrapping and development of new Spring Applications
- Spring Security 6 - Spring Security is a powerful and highly customizable authentication and access-control framework.
- Maven - Dependency Management
- H2 - Java SQL database
- Lombok - Java library to reduce boilerplate code
- Thymeleaf - Java template engine for processing and creating HTML, XML, JavaScript, CSS, and text
To run this project clone this repository and run the following commands:
mvn clean install
This command will build the project and download the required dependencies.
mvn spring-boot:run
This command will run the project. Navigate to http://localhost:8080/api/v1/callback to see the project running.
you also can use ./mvnw spring-boot:run
to run the project.
- Register App in https://intra.42.fr
- Set up
UID42
,SECRET42
environment variables, used inresources/application.yaml
- Run app, check http://localhost:8080/api/v1/callback to authenticate with 42 OAuth2
- Check http://localhost:8080/api/v1/welcome to see user info
If you have any questions, suggestions, or critiques, please contact me using email or through LinkedIn.