Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dewantrie/springboot-custom-authentication-provider
This tutorial demonstrates how to implement a custom authentication provider in a Spring Boot application
https://github.com/dewantrie/springboot-custom-authentication-provider
authentication-provider spring-boot thymeleaf
Last synced: about 9 hours ago
JSON representation
This tutorial demonstrates how to implement a custom authentication provider in a Spring Boot application
- Host: GitHub
- URL: https://github.com/dewantrie/springboot-custom-authentication-provider
- Owner: dewantrie
- Created: 2023-07-01T14:51:42.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-07-01T15:00:34.000Z (over 1 year ago)
- Last Synced: 2024-11-11T23:30:51.103Z (2 months ago)
- Topics: authentication-provider, spring-boot, thymeleaf
- Language: Java
- Homepage:
- Size: 68.4 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot Custom Authentication Provider
This project demonstrates how to implement a custom authentication provider in a Spring Boot application. By using a custom authentication provider, you can extend the default authentication mechanism provided by Spring Security and integrate your own authentication logic.
## Prerequisites
- Java Development Kit (JDK) 8 or later
- Spring Boot 2.x
- Maven build tool## Getting Started
Follow these instructions to get a local copy of the project and run it on your machine.
1. Clone the repository:
```
git clone https://github.com/dewantrie/springboot-custom-authentication-provider.git
```2. Navigate to the project directory:
```
cd springboot-custom-authentication-provider
```3. Build the project using Maven or Gradle:
- **Maven**:
```
mvn clean package
```4. Run the application:
```
java -jar target/springboot-custom-authentication-provider.jar
```5. The application should now be running locally on `http://localhost:8081`.
## Configuration
To configure and customize the authentication provider, modify the `CustomAuthenticationProvider` class in the project. This class implement the `AuthenticationProvider` provided by Spring Security and overrides the `authenticate` method to implement your own authentication logic.
In addition, you can modify the Spring Security configuration in the `SecurityConfig` class to specify which URLs require authentication and other security-related settings.