Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yanbrasiliano/gateway-auth
This repository provides a simple example of using the gateway-auth module to authenticate users against an LDAP server. It demonstrates the setup and integration process, making it easy to implement LDAP authentication in your projects.
https://github.com/yanbrasiliano/gateway-auth
laravel ldap ldap-authentication
Last synced: about 4 hours ago
JSON representation
This repository provides a simple example of using the gateway-auth module to authenticate users against an LDAP server. It demonstrates the setup and integration process, making it easy to implement LDAP authentication in your projects.
- Host: GitHub
- URL: https://github.com/yanbrasiliano/gateway-auth
- Owner: yanbrasiliano
- License: mit
- Created: 2024-03-05T22:27:57.000Z (8 months ago)
- Default Branch: main_without_change_dockerfiles
- Last Pushed: 2024-06-04T13:31:46.000Z (5 months ago)
- Last Synced: 2024-06-04T15:16:53.668Z (5 months ago)
- Topics: laravel, ldap, ldap-authentication
- Language: PHP
- Homepage:
- Size: 168 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API Gateway LDAP Authentication
API Gateway project example for user authentication using LDAP at the University of the State of Bahia (UEFS).
## Configuring LDAP Credentials in the .env File
Before starting authentication, it is essential to configure the LDAP credentials in your environment configuration file (`.env`). Make sure you provide the correct LDAP server information, including the server address, port, base DN (Distinguished Name) for searches, user and password, as required for connection and authentication to the LDAP server.
Example of settings in the `.env` file:
```bash
LDAP_HOSTS=LDAP_SERVER_HOST
LDAP_BASE_DN=DN_BASE_FOR_LDAP_SEARCH
LDAP_USER=CN_USER_LDAP
LDAP_PASSWORD=LDAP_USER_PASSWORD
```## Testing LDAP with LDAPWhoAmi
```bash
ldapwhoami -H ldap://10.65.101.200 -D "CN=test,OU=Users,DC=uefs,DC=br" -x -W
```
After running the command, you will be asked to enter the password for the user `CN=test,OU=Users,DC=uefs,DC=br`. If the password is correct, you will see the following output:```bash
dn:CN=test,OU=Users,DC=uefs,DC=br
```## Generating API documentation
To generate the Swagger API documentation for your project, you can run the following artisan command:
```bash
php artisan l5-swagger:generate
```### Accessing the API Documentation
Once the API documentation has been generated, you can view it by visiting the following URL in your web browser locally:
```bash
localhost:8001/api/documentation#/
```