Dispatcher is not caching when Basic Auth is enabled | Community
Skip to main content
kaikubad
New Participant
Feb 9, 2023 5:43 AM UTC
Solved

Dispatcher is not caching when Basic Auth is enabled

I have enabled basic auth from dispatcher for our dev and stage server.
But its not caching content when basic auth is enabled.

If I disable basic auth then it works. For basic auth I have added following code on dispatcher

<Directory "${PUBLISH_DOCROOT}">
<If "req('Host') =~ /(dev|stage)\.example\.com/">
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/httpd/.htpasswd
Require valid-user
</If>
<Else>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Else>
</Directory>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ChitraMadan
ChitraMadanAccepted solution
New Participant
Feb 9, 2023 10:48 AM UTC

Hi @kaikubad ,

 

You need to set /allowAuthorized "1" in your dispatcher config.

 

 

 

Thanks,

Chitra

6 replies

ChitraMadan
ChitraMadanAccepted solution
New Participant
Feb 9, 2023 10:48 AM UTC

Hi @kaikubad ,

 

You need to set /allowAuthorized "1" in your dispatcher config.

 

 

 

Thanks,

Chitra

Translate
Umesh_Thakur
New Participant
Feb 9, 2023 8:32 AM UTC

Can you validate you response headers for authorisation  and that perticular header is enable for caching or not in your dispatcher.any file.

Hope this helps

Umesh Thakur

Translate
kaikubad
kaikubadAuthor
New Participant
Feb 9, 2023 9:35 AM UTC

can you please explain more or provide a sample code ?

Translate
SivakumarKanoori
New Participant
Feb 9, 2023 5:59 AM UTC

@kaikubad 

Did you check the below configuration is enable in your publish instance

(http://localhost:4503/system/console/configMgr/org.apache.sling.engine.impl.auth.SlingAuthenticator)

Translate
Thanks,Siva
kaikubad
kaikubadAuthor
New Participant
Feb 9, 2023 6:03 AM UTC

@sivakumarkanoori 

Its not the path I have chosen. and yes the configuration is enabled on publish.

Translate