Dispatcher is not caching when Basic Auth is enabled | Community
Skip to main content
kaikubad
New Participant
February 9, 2023
Solved

Dispatcher is not caching when Basic Auth is enabled

  • February 9, 2023
  • 4 replies
  • 1555 views

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.
Best answer by ChitraMadan

Hi @kaikubad ,

 

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

 

 

 

Thanks,

Chitra

4 replies

ChitraMadan
ChitraMadanAccepted solution
New Participant
February 9, 2023

Hi @kaikubad ,

 

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

 

 

 

Thanks,

Chitra

Umesh_Thakur
New Participant
February 9, 2023

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

kaikubad
kaikubadAuthor
New Participant
February 9, 2023

can you please explain more or provide a sample code ?

SivakumarKanoori
New Participant
February 9, 2023

@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)

Thanks,Siva
kaikubad
kaikubadAuthor
New Participant
February 9, 2023

@sivakumarkanoori 

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