From dc9434f8f21774aea637acb1fbd75197089ce0b0 Mon Sep 17 00:00:00 2001 From: Anton Smith Date: Mon, 8 Jul 2019 19:50:35 +1200 Subject: [PATCH] DOCS - replacing the default authenticator --- docs/en/developer.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/en/developer.md b/docs/en/developer.md index d0fc89c..26f6443 100644 --- a/docs/en/developer.md +++ b/docs/en/developer.md @@ -8,7 +8,9 @@ This guide assumes that you already have a running Active Directory server which - [Install the module](#install-the-module) - [Configure SilverStripe Authenticators](#configure-silverstripe-authenticators) - - [Bypass LDAP login form](#bypass-ldap-login-form) + - [Show the LDAP Login button on login form](#show-the-ldap-login-button-on-login-form) + - [Set LDAP as default authenticator](#set-ldap-as-default-authenticator) + - [Bypass auto login](#bypass-auto-login) - [Configure LDAP synchronisation](#configure-ldap-synchronisation) - [Connect with LDAP](#connect-with-ldap) - [Configure LDAP search query](#configure-ldap-search-query) @@ -117,6 +119,32 @@ if (getenv('LDAP_HOSTNAME') && getenv('LDAP_USERNAME') && getenv('LDAP_PASSWORD' } ``` +### Set LDAP as default authenticator + +If you’d like to set LDAP as the default authenticator, you will need to reset the list of authenticators first. You can achieve this with the following approach in the `mysite/_config/ldap.yml` file: + +``` +--- +Name: authreset +After: + - '#coresecurity' +--- +SilverStripe\Core\Injector\Injector: + SilverStripe\Security\Security: + properties: + Authenticators: null +--- +Name: myldapsettings +After: + - '#authreset' +--- +SilverStripe\Core\Injector\Injector: + SilverStripe\Security\Security: + properties: + Authenticators: + default: %$SilverStripe\LDAP\Authenticators\LDAPAuthenticator +``` + ### Bypass auto login If you register the LDAP authenticator as the default authenticator, it will no longer allow you to login with unsynchronised users (e.g. the default "admin" user for local development).