Expand my Community achievements bar.

SOLVED

Anonymous user missing css

Avatar

Level 3

I'm attempting to configure AEM so that you can share assets with anonymous users through sharing a link or a collection, and it works somewhat, only anonymous users aren't seeing the CSS:

In the browser console I get two errors from the linkshare.html page:

 

linkshare.html?path=/content/dam/collections/4/4qh_B3kBIUAA3KDxP_d0/shared_collection&sh=f9efa7e1_e…:11 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:4502/apps/granite/core/content/login.html?resource=%2Flibs…ibs.css&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown". linkshare.html?path=/content/dam/collections/4/4qh_B3kBIUAA3KDxP_d0/shared_collection&sh=f9efa7e1_e…:12 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:4502/apps/granite/core/content/login.html?resource=%2Fapps…ded.css&$$login$$=%24%24login%24%24&j_reason=unknown&j_reason_code=unknown". Refused to execute script from 'http://localhost:4502/libs/granite/ui/components/endor/clientlibs.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled Refused to execute script from 'http://localhost:4502/apps/dam/gui/components/admin/adhocassetshare/clientlibs/shareembedded.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

 

I don't get these errors when I am an authenticated user.

I have "Allow Anonymous Access" checked at /system/console/configMgr/org.apache.sling.engine.impl.auth.SlingAuthenticator

I also gave anonymous access to read "/", just for testing purposes. 

Pictured: These permissions

 

It appears that it's trying to load in the stylesheets (one in /libs, one in /apps), but it can't because it's being sent as text/html.

1 Accepted Solution

Avatar

Correct answer by
Level 3

Fixed it. I needed to change my Apache Sling Authentication Service and add allow specific routes to be accessible without authorization:

-/apps/dam/gui

-/libs/granite/ui

-/apps/granite/core/content

This enabled the CSS.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 3

Fixed it. I needed to change my Apache Sling Authentication Service and add allow specific routes to be accessible without authorization:

-/apps/dam/gui

-/libs/granite/ui

-/apps/granite/core/content

This enabled the CSS.

Avatar

Level 5

Hey grantc I am also trying to expose http://localhost:4502/linkshare.html to anonymous users. Do you mind taking a look at my apache sling authentication service:

Screen Shot 2017-12-07 at 08.42.50.png

  • Does something seem wrong to you?
  • Do you really need to check the 'Allow Anonymous Access' checkbox?
  • Do I also need to give the anonymous user access to read "/"?