Enable basic authentication on AEMAaCS stage dispatcher | Community
Skip to main content
Level 5
July 21, 2023

Enable basic authentication on AEMAaCS stage dispatcher

  • July 21, 2023
  • 1 reply
  • 2300 views

Hi All,

 

I have a requirement to enable basic authentication on stage dispatcher. Idea is to create a sample/test user through which stage dispatcher will be accessible.

I was going through below link

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/how-to-enable-basic-authentication-for-non-prod-aem-websites/m-p/425965#:~:text=Enable%20Basic%20Authentication%3A%20Most%20of,google%20search(another%20approach%20to

 

But I am not sure how to run the below commands on cloud

htpasswd -c /etc/httpd/conf.d/htaccess/credential.htpasswd testuser

Is there any other way around I can achieve this on AEM cloud environment?

 

Any help is highly appreciated.

 

Thanks,

Pradeep 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

joerghoh
Adobe Employee
Adobe Employee
July 21, 2023

You can run this command on your local machine and include the resulting file in a dispatcher deployment. Technically it's possible, not sure if the constraints given the by the dispatcher in AEM CS allows you to do that.

 

Why do you want to have that? Keeping the google bot and drive-by-traffic out of your stage env? Or is it a more serious requirement for authentication?

Level 5
July 24, 2023

Yes we need to avoid stage data to go to google search engine that is one of the requirement.

 

Now what I did as per the link above 

 

authentication.conf file has below content

 

## unsets authorization header when sending a request to AEM
 
RequestHeader unset Authorization
 
AuthType Basic
 
AuthBasicProvider file
 
AuthUserFile /home/test-project/dispatcher/conf.d/htaccess/credential.htpasswd
 
AuthName "Authentication Required"
 
Require valid-user
 
And this file is included in v host file without any conditions.
<IfModule disp_apache2.c>
Include /home/test-project/dispatcher/conf.d/htaccess/authentication.conf
# Some items cache with the wrong mime type
# Use this option to use the name to auto-detect mime types when cached improperly
ModMimeUsePathInfo On
# Use this option to avoid cache poisioning
# Sling will return /content/image.jpg as well as /content/image.jpg/ but apache can't search /content/image.jpg/ as a file
# Apache will treat that like a directory.  This assures the last slash is never stored in cache
DirectorySlash Off
# Enable the dispatcher file handler for apache to fetch files from AEM
SetHandler dispatcher-handler
</IfModule>
 
Still site is opening without credential popup.
 
Level 3
June 7, 2024

Hi

 

Were you able to get this working by any chance. If yes, can you please share the detailed steps followed.

We have the same requirement to enable login popup for basic authentication in dev environment.