Configure a public site in AEM (CQ5) - content-management-system

Current Behavior
I have a Publish Node at "http://pubXX.correlate.net/", when I hit this particular URL it prompts me to log in. Once I log in it takes me to "http://pubXX.correlate.net/projects.html"
As a admin I can see a Site ("Geometrixx Outdoor Site") available to me and I can view the Site at "http://pubXX.correlate.net/content/geometrixx-outdoors/en.html"
Future Behavior Required
I need to configure the Publish Node such that any user who requests for "http://pubXX.correlate.net/" is directly taken to the "Geometrixx Outdoor Site" either after or prior to log in prompt. If it is not possible to configure it this way, please point out the closest possible solution to this.
I am new to AEM and CQ hence I am not aware of the configuration scenarios, excuse me if I have missed out other critical details required to analyse the problem (if so please point that to me and I will provide the same).
Hoping to get a quick response, and I thank all for their help.

Note before: Please make sure your runmode is Publish. You can check:
/system/console/config -> Tab 'Sling Settings'
See more info how to set: http://helpx.adobe.com/experience-manager/kb/RunModeSetUp.html
I see two challenges:
Redirect toplevel domain
The page should be forwarded directly from your top-level domain to a specific page. This can be done by configuring a slingmapping which forwards the page right page on request.
See more info: http://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html
Login
For a login you can configure the Closed User Groups (CUG) mechanism. With configuring this you can force a user to login for a specific part of your site-tree. This configuration can be set on the pageproperties (tab advanced). On this tab you can configure the allowed usergroups and the login page. When the user reaches a site which is part of the CUG (page self or childeren), AEM will forward he user to the login page. After login the user will be redirected back to the referer page.
On the out-of-the-box login component you can configure a success page in case the user lands directly on the loginpage (no referer).
See more info: http://dev.day.com/docs/en/cq/5-6/howto/create_apply_cug.html

Related

Redirect to page after successfully entering in information in Squarespace

I have a page in Squarespace that I only want viewable after someone inputs their contact information. For example, I would create a Form Block, and then direct them to the otherwise locked page so they can view for that session. But if they close the window, they would need to re-enter their information (Name + Email).
lets say the address to the otherwise unviewable page is www.website.com/access
Once the viewer puts in their Name + Email and hit submit, they can see the /access page. If they do that and say share the address with someone who has not entered in their information, then they would get the Form Block where they need to enter their information.
Is there a way to do this in Squarespace? Would that need to be done with some sort of PHP Session that can be injected into the header of the specific page?
Ideally it would be like if they could see the page which is normally hidden, but of course unless they are an admin, the page is not viewable to the public.
Squarespace doesn't support PHP since it uses JSON template, so you can't create a session there. Please refer to this page: https://support.squarespace.com/hc/en-us/articles/205815358-Custom-code-FAQ
The only option to achieve this will be to create a cookie via JS and redirect if there is no cookie. The page will be still accessible if you turnoff the JS.
Please have in mind that SquareSpace is very limited when it comes to this kind of changes.

Logout functionality in OutSystems

I am working on web app in OutSystems 10.0. In the application, if I log out, it logs off. But when I click the browser back Button, it redirects to the Previous page (which should be displayed only after login). Any suggestions?
You probably need to have roles on the pages, if the pages have the role anonymous anyone can open it.
You're probably accessing the website via http and not https, so when you press back on the browser it will show you a cached version of the previous page.
Because it's the cached version, the session and roles are not checked.
As a recommendation, force the https protocol.
Following the link provided by #Abdulhakeem, they recommend the following:
Add a hidden input to the page - initialize it to some value (for example 'no') - so when the page is rendered by the server it always has a 'no'
Add a bit of Javascript to the page ready event to:
Check that value - if it's not what you'd expect from the server (in our case, <> 'no'), force refresh the page (see below)
If it is still set to what you'd expect from the server, change it (in our case to 'yes') and do nothing else
I recommend downloading the .oml provided in the post and reviewing how they actually implemented it.
if you can change to https, you can also in every action that is on the page that do changes on the database. check if you have permissions or you are logged. that way if the person tries to do back and do some action you can redirect it somewhere.

CQ5.6 - CUG enabling for protecting pages breaks other components

We have implemented login functionality like geometrixx site in our existing website(with close to 700+ pages).
We want to show protected pages only to logged in user, every user who is registered gets assigned a group/ CUG lets say "listed users".
now in page hierarchy I have products page and under product page I have 8 products pages.somewhere On homepage I have a nav bar component which fetches all product children pages and shows a left nav bar with 8 entries.
If I enable CUG in a way that only "listed users" should have access to 2 out of 8 product pages, any access to direct links are redirected to login page. Which is fine.
But the nav bar component which earlier used to show all 8 product pages now shows only 6 pages.
The main idea behind putting pages behind login is lead generation.So if non logged in users dont see the link itself where would they click to get redirected to login page and subsequently feel like registering with our site.
Requirement is that my existing nav bar should continue showing 8 links and on click of 2 protected page links, he should get login/ register option.
We are using most of things Out of the Box.
any pointers helping in how do we achieve this would be great help ? PS: i have given a nav bar as one such component affected in existing site like this there could be many more components fetching their content from site hierarchy and stand chance to get broken in such case.
There are two entities involved, JCR and Sling.By default any un-authenticated request is associated with a user called Anonymous, the JCR sessions will have ACL's associated with anonymous.
In JCR, if a user does not have access to nodes, that session will not see those nodes.We access the JCR via Sling ,by default if you don't have permission the request will result in a 404 error(because for underlying JCR session the resource does not exist). Sling can be explicitly instructed to request for authentication for specific paths.
The combination of these concepts are leveraged to create the CUG functionality. Sling is instructed to force for authentication for CUG enabled pages. The JCR is instructed to show these nodes only for users who have access.
When you directly request the product pages without login, it is sling that is redirecting you to login page. When your navigation component is looping over nodes to create the menu for anonymous users JCR is only showing it 6 pages as the other two are out of reach for anonymous.
The only* way to work around this is to make the Navigation component configurable. Instead of node iteration, the content author will have to configure the the url and page title so that the links show up for everyone.
You can ignore the session associated with the request and use a custom JCR session that has access to all the product pages, but that would be disregarding the ACLs and you don't want to do that .
The nav bar can pick up all child pages as per page structure. That should not restrict the page title display on the nav bar.
As for the pages the access can be controlled by template level page properties by adding the 'listed users' group over there. In the jsp you can give an initial check for the user if they are a member of 'listed users' else redirect to login page
Hope that helps
Thanks for all your suggestions
Below is how we ended up doing it.
- Protect the page you want to enable CUG with proper CUG.
- Hide the page in nav.
- Create a redirect page in same hierarchy with same title as the one you wanted to protect.redirect it to your protected page.

How to intercept error request and redirect to a custom page?

Here is one of the use-case as to what I want to do:
A User clicks on a blog-link or directly pastes the blog-link in the URL
The blog portlet is on the private-page of a Community (Site).
Since the user is not a member of the Community (Site) he would be taken to the error page.
He is shown, either a 404 page or a No-access error page.
My requirement starts: Now instead of showing the above pages or a customized version of the above pages.
I want to Intercept the request for 404 or other such requests.
And redirect to a portal page (not a static error page) based on some parameters of the User and the initial request parameters.
In this case I would want the user to be redirect to any public page of the same Community (Site) and ask him to Join or request membership for that Community (Site).
So in short I would want a way to intercept the request which generates the error and then redirect to where ever I want.
Is this available in liferay? If not can I get some idea as to how can I achieve this?
Environment: Liferay 6.1 GA2
Thanks for your valuable time.
Add a JSP page to manage 404 errors as described here in that Liferay's forum post.
In that JSP you can put your custom logic based on whatever param (the user, the community, etc..) that you can access from inside the JSP using, for example, the themeDisplay object.
An alternative way (and the way I have redirect 404 errors to a specific page in the community) is to override the 404.jsp with a Hook. Then add your custom logic to the overridden JSP.
I'm assuming something similar could be done for no-access.

AuthenticationHandler: sling always redirecting to gemotrix login page

I am implementing login functionality for my site using Custom AuthenticationHandler. When I give credentials and submit the form the AuthenticationHandler is always redirecting to geometrix site and asking geometrix credentials.
Even I tried deactivating geometrix in my author instance, after login into my site again it is redirecting to felix console site.
How to restrict other than my application pages ?
Any help is highly appreciable.
You can change your default login page from felix console
http://localhost:4503/system/console/configMgr
Configure Day CQ Login Selector Authentication Handler, set the default login page to the path of your custom login page
I guess the Day CQ Root Mapping servlet redirects you to it's configured rootmapping target.
Have at look at
/libs/cq/core/config.publish/com.day.cq.commons.servlets.RootMappingServlet
inside crxde.
The rootmapping servlet's config targets to /content.html which is resolved to /content. redirect that to your content or if it has to coexist, then create an additional JcrResourceResolverFactoryImpl config.
Just create a config.publish/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl
node below your application in apps
/apps/<yourappp>/config.publish/org.apache.sling.jcr.resource.internal.JcrResourceResolverFactoryImpl with jcr:primaryType sling:OsgiConfig and add a resource.resolver.mapping to your like the following samples demonstrates.
resource.resolver.mapping="[/-/,/content/intranet/-/intranet-/, ....]" />