How to enable Basic Authentication for Non-Prod AEM websites? | Support Authenticated Performance Testing with Cloud Manager | AEM Community Blog Seeding

How to enable Basic Authentication for Non-Prod AEM websites? | Support Authenticated Performance Testing with Cloud Manager by Albin Issac
Abstract
Enable Basic Authentication: Most of the time we will have the use case to enable basic authentication for non-prod AEM websites to avoid non authenticated users accessing the content(another option is through IP whitelisting) also avoiding the non-prod contents getting indexed through google search(another approach to avoid the indexing is through Robots meta tag) Easy to use generic user name/password for every website so that only the users know those credentials can access the password(if you need more security go with site-specific users or individual users) In AEM the basic authentication can be enabled quickly through Dispatcher(Apache) Create a common configuration file for authentication — /conf.d/htaccess/authentication.conf ## unsets authorization header when sending a request to AEM RequestHeader unset Authorization AuthType Basic AuthBasicProvider file AuthUserFile /etc/httpd/conf.d/htaccess/credential.htpasswd AuthName “Authentication Required” Require valid-user Include this file into the individual Virtual Hosts Include /etc/httpd/conf.d/htaccess/authentication.conf The ENV_TYPE can be set as an Environment variable e.g /etc/sysconfig/httpd (for AMS environment the required environment variables will be enabled by default) ENV_TYPE=’dev’ Create the credential file, execute the below command, you will be prompted to enter the password htpasswd -c /etc/httpd/conf.d/htaccess/credential.htpasswd testuser Execute the below command, to add additional users if required htpasswd /etc/httpd/conf.d/htaccess/credential.htpasswd testuser1 Restart the Apache server, now basic authentication is enabled for the websites.
Read Full Blog
How to enable Basic Authentication for Non-Prod AEM websites? | Support Authenticated Performance Testing with Cloud Manager
Q&A
Please use this thread to ask the related questions.
