Example: enable auth and use database as default users backend

This commit is contained in:
Benjamin Renard 2023-03-07 18:50:05 +01:00
parent 5ab7b35cc3
commit f662837ffd

View file

@ -147,7 +147,7 @@ db:
# #
auth: auth:
# Enabled authentication # Enabled authentication
enabled: false enabled: true
# Methods to authenticate users # Methods to authenticate users
methods: methods:
@ -157,7 +157,7 @@ auth:
# User backends # User backends
backends: backends:
- ldap - db
# #
# Login form # Login form
@ -226,6 +226,30 @@ auth:
# CAS Fake authenticated user # CAS Fake authenticated user
#fake_authenticated_user: 'myusername' #fake_authenticated_user: 'myusername'
#
# Database user backend
#
db:
# DSN (required)
dsn: "${db.dsn}"
# Username (optional but could be required with some PDO drivers)
user: "${db.user}"
# Password (optional)
password: "${db.password}"
# PDO options (optional)
options: "${db.options}"
# Users table name (optional, default: users)
users_table: "users"
# Username field name (optional, default: username)
username_field: "username"
# Password field name (optional, default: password)
password_field: "password"
# Exposed users table fields in resulting EesyPHP\Auth\User object
# (optional, defailt: name, mail)
exposed_fields:
- "name"
- "mail"
# #
# LDAP user backend # LDAP user backend
# #