This project provides a custom authenticator for Keycloak-24.0.3, implementing custom logic for user login and registration processes.
Prerequisites Installation Configuration Usage Development Contributing License
Before you begin, ensure you have the following prerequisites:
Java Development Kit (JDK) 11 or higher
Apache Maven
A running instance of Keycloak (version 12.0.0 or higher is recommended)
Clone the repository:
git clone https://github.com/Rajeshkanth/custom-authenticator.git
cd custom-keycloak-authenticator
Copy the generated JAR file from the target directory to the providers directory of your Keycloak server:
cp target/custom-authenticator.jar /opt/keycloak/providers/
or
./script.sh
this command will automatically run the mvn clean package and will move the jar files in the provider folder in target destination
/opt/keycloak/bin/kc.sh stop
/opt/keycloak/bin/kc.sh start
Log in to the Keycloak admin console:
Open your web browser and go to http://<your-keycloak-domain>/auth/admin/ and log in with your admin credentials.
Navigate to the appropriate realm:
Select the realm where you want to configure the custom authenticator.
Go to Authentication -> Flows.
Click Add to create a new flow or select an existing flow to modify.
Add a new execution with the type Custom Authenticator.
Configure the custom authenticator:
Click on Actions -> Add Execution.
Select Custom Authenticator from the list.
Click Save.
Click Actions -> Config.
Configure the authenticator as needed.
Click Save.
Once configured, the custom authenticator will be used in the specified authentication flow for login and registration.
Login
Users attempting to log in will be directed through the custom authentication logic.
Registration
New users registering will also pass through the custom authentication process.
If you want to contribute to this project or customize it further, follow these steps:
Set up your development environment:
Ensure you have JDK 11 or higher and Apache Maven installed.
Clone the repository:
git clone https://github.com/your-username/custom-keycloak-authenticator.git
cd custom-keycloak-authenticator
Modify the existing authenticator or add new ones in the src/main/java directory.
mvn clean install or mvn clean package
Deploy and test:
Deploy the updated JAR file to your Keycloak instance and test your changes.
By running either mvn clean packge or ./script.sh to build the jar file.
We welcome contributions to this project. Please open an issue or submit a pull request on GitHub if you have any improvements or bug fixes.
This project is licensed under the MIT License.