The application shows the implementation of remote authentication using OIDC over the ldap protocol using lldap and keycloak with backend on Golang and frontend on NextJS.
- Docker
- Docker Compose
- pnpm
Before starting, ensure that the .env file is downloaded from group
File .env for directory backend_go/
HOST=... # Backend host
PORT=8081 # Backend port
KAFKA_BROKERS=... # For example kafka:9092
KAFKA_TOPIC=... # Kafka topic
KAFKA_CONSUMER_GROUP=... # Group for Kafka
PROMETHEUS_PORT=9090 # Port for Prometheus (9090 default)
KEYCLOAK_BASE_URL=... # Address of keycloak service
KEYCLOAK_REALM=... # Your Realm
KEYCLOAK_REST_API_CLIENT_ID=... # Client's ID
KEYCLOAK_REST_API_CLIENT_SECRET=... # Client's secret
LDAP_HOST=... # Address of ldap service. Use ldap://...
LDAP_BASE_DN=... # Configuration for Ldap
LDAP_USER_DN=... # Configuration for Ldap
LDAP_USER_PASSWORD=... # Password for LdapFile .env.local for directory frontend/
# .env.local for frontend
NEXT_PUBLIC_BACKEND_IP=... # For example, http://localhost:8081 (address for backend)- Using for installing dependencies :
cd frontend/
pnpm install- Using for starting frontend on port ":3000":
pnpm dev -p 3000- Build and start the containers (the launch will take approximately 2 minutes):
cd backend_go
docker compose up --build -d- Check container status:
docker compose ps- Frontend:
http://localhost:3000 - Go application:
http://localhost:8081 - Kafka UI:
http://localhost:8082
cmd/- application entry pointconfig/- configurationauth/- authenticationmiddleware/- middleware components
Logs are sent to the Kafka topic logs. To view logs, use Kafka UI http://localhost:8082
Using my "Avaliable Services" I go to the http://localhost:3000 and see box with username and password fields. Fill it and press "Sign in". If Lldap has your username and password and you input valid data you will get page with timer, your name, email, amd roles.
We use SOL License to protect against the plagiarism by students and MIT License for the other projects to use