Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

CUG login issue

Gaurav_Sachdeva1
Level 2
Level 2

Hi Team,

 

I have multiple CUG's enabled on my site. 

User of one CUG gets 404 error while accessing content of other CUG member .

we need to have login page of that CUG  instead of 404 error page.

If anyone has encountered similar scenario then your suggestions are welcome.

 

Thanks,

Gaurav

 

 

 

1 Accepted Solution
Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

If the user is already logged in and able to access page1 where cug groups allowed user to view content and will not be able to access a page2 if user is not part of cug group.

If user is anonymous then only you can redirect user to login page as soon as user try to hit protected page. to achieve this you can create a sling filter which will check the protected page and user type and take actions.

To handle cache protected content you need to implemented permission sensitive caching .https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/permissions-...

View solution in original post

10 Replies
Gaurav_Sachdeva1
Level 2
Level 2

Thanks ,,this is different issue mine is different. In the issue you are refering has only one cug group and  redirection not working to login page. Here it's totally different scenario.

Arun_Patidar
Correct answer by
Community Advisor
Community Advisor

Hi,

If the user is already logged in and able to access page1 where cug groups allowed user to view content and will not be able to access a page2 if user is not part of cug group.

If user is anonymous then only you can redirect user to login page as soon as user try to hit protected page. to achieve this you can create a sling filter which will check the protected page and user type and take actions.

To handle cache protected content you need to implemented permission sensitive caching .https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/permissions-...

View solution in original post

Gaurav_Sachdeva1
Level 2
Level 2
Hi thanks for replying,, Actually If user is anonymous then it is already going to login page via ootb cug functionality. Issue is when user is not anonymous and part of any cug group and trying to access content which require login from another cug group member. There page 404 is coming, we need to have login page there.
Arun_Patidar
Community Advisor
Community Advisor
with ootb cug you can have one aem user session at a time, and ootb aem session take care of service protected pages or send user 404 if not intended user. What is your use case here, why you want to created multiple session for the user, instaed add user into the desire groups in the fly so that user can see the content.
gauravsachdeva3415
Level 1
Level 1

so the use case is :

user "A" is a member of CUG group "GroupA" and GroupA has read permission on /content/test/testsiteA/en.
It has login page configured with it at /content/test/testsiteA/login

similarly user "B" member of CUG group "GroupB" and GroupB has read permission on /content/test/testsiteB/en.

It has login page configured with it at /content/test/testsiteB/login

 

Now if user hits /content/test/testsiteA/en he lands on /content/test/testsiteA/login and able to login and render site /content/test/testsiteA/en
somewhere there is reference to page "/content/test/testsiteB/en/xyz"
when he hits this page 404 error comes ..

Here need is to get /content/test/testsiteB/login first and then render /content/test/testsiteB/en/xyz.

Also, we cannot keep common login page as it is multi tenant environment .
I tried to give read permission to login pages of other CUG groups ,
hence A can access /content/test/testsiteB/login and after login as different user can access /content/test/testsiteB/en/xyz

 

 

Thanks

Arun_Patidar
Community Advisor
Community Advisor

Hi,

AEM does create a login cookie on a domain or subdomain, if you are using a single domain then it is not possible to create multiple AEM sessions per portal. SO user A would have the session but restricted to access the content at /content/yoursite/B.

If you are using different domains for site A and B then it should work.

Gaurav_Sachdeva1
Level 2
Level 2
Yes that functionality is working fine previous user session is getting closes when we are logging with different uses, that is not a issue. Only we need to have login page instead of 404.
ruchim71073425
Level 2
Level 2

We had a similar issue with different users having access to different sections on the site, and if a logged-in user tried to access content of another group, they were seeing 404 page.

We implemented a service accessed by a component on our 404 page, that checked if it is a logged-in user and some other checks and responded with a specific message on the page.

This was the only way we could achieve our requirement.

I would be interested to know if there is another way possible.

 

Regards

Ruchi

gauravsachdeva3415
Level 1
Level 1

Yes I will try to find any better way and let u know , otherwise this is the best way which you told, thanks