AuthenticationHandler: sling always redirecting to gemotrix login page - aem

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-/, ....]" />

Related

Backbase redirection issue

I'm running a portal based on Backbase and I have recently added a new LINK file (let's call it myLastLinkPath) in the following path:
src/main/import-scripts/portal/myPortal/links
The problem now is that when I access (through the browser) to my site, it redirects automatically to the last added link.
I mean, if I go to www.mysyte.com, it is redirectected to www.mysite.com/myLastLinkPath
It is the Default Landing Page of your portal.
You can check this in the portal configuration page, in the special pages tab

Configure a public site in AEM (CQ5)

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

Integrate GWT with Spring Security with custom login page

I have followed
http://krams915.blogspot.hk/2011/01/spring-and-gwt-security-via-spring.html
to build a GWT app with spring security with custom login page.
However, How can I handle the followings things?
1) If the user is not logged in, direct the user to login page, but not showing the HTTP ERROR page.
2) after the user is logged in, direct the user to front page or previous page but not /j_spring_security_check
I have tried replacing /j_spring_security_check in the loginpage.jsp to the /XXXEntry.html?gwt.codesvr=127.0.0.1:9997. I can successfully redirect back to the GWT app, but it stills said that Authentication required.
Could anybody help? Better with code examples. Thanks a lot!!
I have found another solutions for GWT and Spring Security integration:
http://www.site.lalitbhatt.com/spring-security-gwt-integration
this article make a login.html rather that jsp. Very easy to understand and implement.
Everthing works fine now.
Updated: The link moved to http://tech.lalitbhatt.net/2014/08/spring-security-gwt-integration.html

Given URL is not allowed by the Application configuration

I am trying to create facebook sign-in page according to this tutorial. I only changed the two lines
appId : '370675846382420', // App ID
channelUrl : '//http://bp.php5.cz/channel.html', // Channel File
and I get the following error
Given URL is not allowed by the Application configuration.: One or
more of the given URLs is not allowed by the App's settings. It must
match the Website URL or Canvas URL, or the domain must be a subdomain
of one of the App's domains.
What might be the problem?
The problem is that whatever url you are currently hosting your app is not setup in your Application configuration. Go to your app settings and ensure the urls are matching.
Updated
Steps:
Go to 'Basic' settings for your app
Select 'Add Platform'
Select 'Website'
Put your website URL under 'Site URL'
This can also happen when the redirect_uri submitted with the https://www.facebook.com/dialog/oauth request is not present in the list of Valid OAuth redirect URIs under:
Settings >> Advanced >> Security
After much trial and error, when I added the redirect_uri that I was using (https://www.facebook.com/connect/login_success.html in my case), I suddenly got to the step past this error.
The above answers are right, but you have to make sure you input right URL.
You have to go to: https://developers.facebook.com/apps
Select your app
Click settings
Enter contact email (for publishing)
Click on +add platform
Add your platform (probably WEB)
Enter site URL
You have two choices to enter: http://www.example.com or http://example.com
Your app will work only with one of them. In order to make sure your visitors will use your desired url, use .htaccess on your domain.
Here's good tutorial on that: http://eppand.com/redirect-www-to-non-www-with-htaccess-file/
Enjoy!
Go to your application, settings (basic tab) and add platform (website). Type your site url and done.
Do the above work of adding the site and then the url.
I think the layout of facebook has changed little bit so also do the below things.
- Go to developers.facebook.com -> your app
- Go to Settings->Advanced.
- Under the Security->Valid OAuth redirect URIs, insert all the uri's your app is supposed to redirect to. For example (
http://localhost:1443/cas/login, https://localhost:2443/cas/login, http://rajanpupa.com/cas/login
etc)
- That should do it.
I faced the same issue. I had entered http://www.example.com in the App settings. When anybody accessed my website using the full URL, Facebook Login worked fine. But if somebody typed in the URL without www in the browser, Facebook Login failed with this error message. When I changed the App Setting to http://example.com everything started working fine.
Go to https://developers.facebook.com/apps and open the app you have created. open setting tab and add platform and insert site url where you want to share facebook button .Its done.
The other answers here are excellent and accurate. In the interest of adding to the list of things to try:
Double and triple-check that your app is using the right application ID and secret key. In my case, after trying many other things, I checked the application ID and secret key and found that I was using our production settings on our development system. Doh!
Using the correct application ID and secret key fixed the problem.
My Problem Solved by
public static final String REDIRECT_URI = "http://google.com";
it will redirect to Url after ur Login into Facebook.and also you have to reach
url : https://developers.facebook.com -> My App -> (Select your app) ->Settings ->Advanced Setting -> Valid OAuth redirect URIs : "http://google.com".
In the place of "http://google.com" you can place ur respective project Url.so,that it will redirect to your Page.
I was getting this error when trying to run my test web page directly from "file:///C:/webtests/myfile.htm". To fix it, I didn't have to make any changes to my App Settings. Instead, I just had to host my HTML file on an actual server and then hit it like: "http://localhost/myfile.htm".
Hope that helps someone.
I'm using the Facebook Canvas platform (Unity WebGL) and I don't needed to add the Website platform. The only thing I did was add my website root url in:
Product
Facebook Login
Valid OAuth redirect URIs
For me it was the "Single Sign On" (can be seen at the bottome of the screenshot in phwd's answer) setting that was turned off.
I ran into this with the IBM BlueMix SSO service and had to use the BlueMix provided redirect URL as my "site" URL instead of my actually web application site URL to fix it. Once I made that change the problem went away.
This can be caused by incorrect app-ID
In my ionic sample I had the same issue because I had inserted a different "app-ID" in my ionic app other than the app-ID I received from Facebook developer account.
so we have to carefully insert the relavent appID
Things have evolved in Facebooks approach, I now realised that you need to
"Add Product" to your App: facebook login.
make sure oauth & web auth on
add my own site url to ""Valid Auth redirect URI" (and removed the default https://www.facebook.com/connect/login_success.html which his in the
Without this I get the URL Blocked error.

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.