Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

AEM as Cloud Service CUG not working as expected

Avatar

Level 2

Hi everyone,

On aem sites as cloud services i have my web content structured as following:

mysite/it/otherpages

mysite/en/otherpages

 

i have activated the proerty "enable authentication" and i have added a closed user group just for "it" section not for "en", by activating my my pages, user and group i am expecting on publish server that whenever a user tries to browse the "it" section aem must require authentication through the login page but the en section remains accessible to anonymous users. But in reality aem require authentication for "it" section  which is fine but "en" section is no more accessible for anonymous user aem return 404.

 

i have already tried to use Apache Sling Authentication Service as alternative but the outcome remains same.

 

Thanks in advance!

 

10 Replies

Avatar

Community Advisor

Are you using MSM for creating mysite/it/otherpages pages?



Arun Patidar

Avatar

Level 2

Hi Arun,

no they are created manually through page creation procedure. if it can help i would like to share that they use static templates.

Avatar

Community Advisor

ok,

are en page accesible with login? can you check anonymous user and if that missing everyone group?



Arun Patidar

Avatar

Community Advisor

@junaids28771920 

Can you clarify from where you are getting 404 Error for "en" page ( Publisher or Dispatcher ) if you are getting 404 error from dispatcher, tail your dispatcher log for the "en" page request and validate your resource resolver or etc mapping configuration for "en" content path in the publisher instance.

 

Regards,

Raja

Avatar

Level 2

@Raja-kp i'm getting the 404 error for en page on publish. Could you please elaborate "validate your resource resolver or etc mapping configuration for "en" content path in the publisher instance."?

 

Thanks a lot.

 

Junaid

Avatar

Community Advisor

Hi @junaids28771920 ,

If possible, can you please share the Apache Sling Authentication Service URL mapping & login page which you have added in the OSGi config.

Avatar

Level 2

Hi @Anmol_Bhardwaj please feel free to point out any mistake and share your suggestions

{
"auth.annonymous":true,
"auth.sudo.cookie":"sling.sudo",
"auth.http.realm":"Sling (Development)",
"sling.auth.requirements":[
"+/libs/granite/oauth/content/authorization",
"+/content/mysite/it",
"-/content/mysite/en"
],
"sling.auth.anonymous.user":"",
"auth.uri.suffix":[
"/j_security_check"
],
"auth.http":"preemptive",
"auth.sudo.parameter":"sudo"
}

 Thanks

Avatar

Community Advisor

These look fine.

Can you try something like this in the "Adobe Granite Login Selector Authentication Handler":

AnmolBhardwaj1808_0-1646036735449.png

 

And just keep the CUG in page properties for the it page. This should only redirect it page & sub-pages to the login page.

 

Hi @Anmol_Bhardwaj 

i have followed steps as you suggeste but the issue is still there the outcome remains unchanged.

 

Thanks

Avatar

Community Advisor

Have you deleted the existing changes which you have already done. Maybe one of them is causing this.

 

Also, the path should include my-site/it/*, to make sure it only picks up pages inside it.

 

I have used this way for CUG login multiple times(6.5.8,6.5.10,6.5.11), and it works.