Integrate GWT with Spring Security with custom login page - gwt

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

Related

How to prevent Auth0 to redirect after logout (ionic app)

I am working on an Ionic 6 app that uses Auth0 for authentication. We are using the embedded login strategy and auth0-js as the client library to talk with auth0.
I've reached to the point where everything works nice if I serve the app on an emulator via ionic serve. I can login and logout effortlessly, and authjs' logout method, which I'm calling as follows:
public logout() {
store.dispatch('endSession');
this.endSession();
this.webAuth.logout({
returnTo: process.env.VUE_APP_LOGOUT_CALLBACK,
clientID: clientId,
});
}
Does redirect me to http://localhost:3000/login as intended (that's the value of VUE_APP_LOGOUT_CALLBACK).
However, when I compile the app and launch it on a mobile phone (I'm using android studio) I have the following problem:
My current problem
After calling WebAuth.logout, the app stops and a browser tab pointing to localhost:3000/login tries to open as if it was a website I'm navigating to. But the behavior I want is for the app to return to the login page, of course.
Other users seem to have found the same issue:
https://community.auth0.com/t/logout-on-ionic-3/20222/9
https://community.auth0.com/t/impossible-to-redirect-user-after-logout-ionic-angular/82205
But no one really solved the issues in those threads. I had no luck finding more resources related to this.
What I've tried
I've tried changing the redirect route to capacitor://localhost/login, hoping it's a way to tell the ionic shell to navigate inside the context of the app, but it didn't work.
I've tried to avoid passing redirectTo as an option to WebAuth.logout(). This makes the method to redirect to the first URL set up on the Auth0 dashboard allowed logout URL, as far as I know.
I've played with a lot of different URL's as returnTo, like / or /login, but it didn't work as I expected and the browser always tries to open such URL as a new website, instead of navigating in the context of the running app.
What would be the ideal outcome
I'd like the app to return to /login, which is the first view the user encounters when they launch the app on the phone.
If that's not possible, maybe it would be possible to just get Auth0 to not redirect at all, so I can perform the redirect by myself and send the user back to the login page.
Maybe there's a way to tell my app not to ever redirect to the redirectUri, even if there's no way for auth0 to avoid trying to redirect the app to another page? Auth0-js docs don't suggest any way to avoid the redirect, but maybe there's a way via ionic config or javascript to make sure the app won't ever redirect to a certain URL.
Thanks for your time!

Unable to login through social login in AEM 6.2

I have configured social login in AEM as given in https://docs.adobe.com/docs/en/aem/6-1/administer/communities/social-login.html. I'm using Geometrix-outdoor component to login. The page is http://localhost:4502/content/geometrixx-outdoors/en.html [on top right corner we have login].
All the configurations are good. When I click login, the pop up for facebook login comes (OAuth login succeeds). When the call back happens, the OAuth Handler is not able to find the class com/day/cq/personalization/ProfileUtil in 6.2. In 6.1 this functionality works fine.
Below is the log:
java.lang.NoClassDefFoundError: com/day/cq/personalization/ProfileUtil
at com.adobe.cq.social.connect.oauth.impl.FacebookProviderImpl.getCurrentUser(FacebookProviderImpl.java:368)
at com.adobe.granite.auth.oauth.impl.servlet.OAuthProfileImportServlet.updateUserDataAndRedirect(OAuthProfileImportServlet.java:130)
at com.adobe.granite.auth.oauth.impl.servlet.OAuthProfileImportServlet.requestAccessToken(OAuthProfileImportServlet.java:115)
at com.adobe.granite.auth.oauth.impl.servlet.OAuthProfileImportServlet.doGet(OAuthProfileImportServlet.java:82)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:269)
at org.apache.sling.api.servlets.SlingAllMethodsServlet.mayService(SlingAllMethodsServlet.java:140)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:345)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:376)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:546)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
It is helpful to identify the root cause and rectify. Thank you
In AEM 6.2, com.day.cq.wcm.foundation.profile.ProfileUtil is deprecated. Please
Use com.day.cq.personalization.ProfileUtil instead.
Social login cannot be used on author nodes. It is only valid on publish nodes because it creates community users. Community users do not exist on author nodes.
I wish the error message were more clear...

Facebook Login Integration in AEM/CQ

I have come across an issue while integrating Facebook login with AEM.
I took reference from below link
https://docs.adobe.com/docs/en/cq/5-6-1/administering/social_communities/social_connect.html
Although everything is working fine but on welcome page it is not displaying the logged in user name the way it is working for Geometrixx Outdoors website.
Instead it is displaiying the ID only.
Any suggestions who have already worked on this integration? :)
When your user logs in from facebook,it will exist as a user in /home/users/facebook under the group you have specified.If it is not there,you need to do it.Dont forget to check the about me part shown in figure ,so that user can save the info with the help of this.User in your aem will fetch only those info which you check here,
And in the welcome page,you need to fetch the user-info from that group and show it on your welcome page,it will not be on the fly.You need to do it like geomatrix.
I have done work on this integration,If you need further help,feel free to ask me.

asp.net webforms - facebook server side authentication on a page tab

I'm struggling for about 2 days with authenticating a user from the server side.
Using asp.net 4, c# web forms and starting to use the C# SDK, building an app for page tab.
I need to authenticate a user with the Oauth diag.
If I use Response.Redirect, I get a blank screen on the tab.
according to http://developers.facebook.com/docs/authentication/pagetab/
I need to send a JS command in order to change window.top.location but how do I do this?
my login url:
https://www.facebook.com/dialog/oauth?client_id=482264391791260&redirect_uri=http://www.facebook.com/pages/null/153715871344670/?sk=app_482264391791260&response_type=code&display=popup&scope=email
Thanks!
I need to send a JS command in order to change window.top.location but how do I do this?
The section entitled 2a. Redirect to OAuth Dialog upon page load on the very same page you mentioned has an example of doing exactly that …
So what exactly is your problem in getting it done?

How To stream.publish Within a Profile Tab

I have successfully setup an iFrame based App using the Javascript SDK, and we are trying to enable it on a Page Tab.
It seems Facebook has changed some things lately, because the app breaks when added to the Page Tab. I even went as far as making sure that all external scripts were included in the main index.php file, and that the body tags were taken out.
No, I'm trying to find out if it is even possible to use methods such as the stream.publish within a Profile Tab at all.
It seems like it isn't. As far as I can tell, you can no longer use any social methods on the Profile Tab.
Here were two related articles on the subject:
insidefacebook.com/2010/08/19/facebook-moving-toward-iframes-over-fbml-for-canvas-apps-and-page-tabs/
-and-
developers.facebook.com/roadmap
If anyone can confirm or deny this, it would be a huge help. The Facebook docs are just all over the place.
Here's a link to the working App Canvas as it stands now: http://apps.facebook.com/votetesting/
I know that on tab pages, you cannot do any JS until the user clicks on something first. Maybe that is the problem.
-Roozbeh