Expand my Community achievements bar.

SOLVED

CUG login issue

Avatar

Level 4

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

Avatar

Correct answer by
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-...



Arun Patidar

View solution in original post

10 Replies

Avatar

Level 4

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.

Avatar

Correct answer by
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-...



Arun Patidar

Avatar

Level 4
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.

Avatar

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.


Arun Patidar

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

Avatar

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.



Arun Patidar

Avatar

Level 4
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.

Avatar

Level 3

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

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