Does SocialAuth work on GAE - Java?

243 views
Skip to first unread message

Ashwin

unread,
Jun 27, 2011, 4:03:57 AM6/27/11
to socialauth-users
Hi,

I was referred to socialAuth by a StackOverflow answer when I was
looking around for a good library which handles most of the grunt work
involved in google/twitter/fb/hotmail authentication of users to a
custom web app. The application I am currently developing will be
hosted on Google App Engine infrastructure, hence I was wondering if
socialAuth and its dependencies pass the app engine JRE whitelist.

I will be trying out a quick and dirty prototype using socialAuth on
GAE to verify this, however it would be nice if to get feedback from
those who have tried/succeeded using this library on app engine java.

Thanks,
Ashwin

Tarun

unread,
Jun 27, 2011, 8:21:38 AM6/27/11
to socialauth-users
Hi Ashwin

Yes it works on GAE also.
Some one use this library in application which was running on GAE. He
was facing some issues and we changed our library to work with GAE.
You can have a look on following URL also:-
http://code.google.com/p/socialauth/issues/detail?id=47

So try this on GAE and let me know if you face any issue.

Regards
Tarun

Ashwin Prabhu

unread,
Jun 27, 2011, 9:29:50 AM6/27/11
to socialau...@googlegroups.com
Hey Tarun,

Thanks for replying. I am trying to work with this library for the past 3-4 hours. I am bale to get the authentication working on my GWT-GoogleApp engine project on my local box with help of the tutorials. I am currently working with basic HttpServlets.

However, I am facing some issues when the app is hosted on app engine, specifically with serialization of the SocialAuthManager, when I try to preserve that object   in the session as mentioned in the getting started tutorials. The culprit is SocialAuthConfig, which is not Serializable.

java.lang.RuntimeException: java.io.NotSerializableException: org.brickred.socialauth.SocialAuthConfig
	at com.google.apphosting.runtime.jetty.SessionManager.serialize(SessionManager.java:358)
	at com.google.apphosting.runtime.jetty.DatastoreSessionStore.createEntityForSession(DatastoreSessionStore.java:71)
	at com.google.apphosting.runtime.jetty.DatastoreSessionStore.saveSession(DatastoreSessionStore.java:93)
	at com.google.apphosting.runtime.jetty.SessionManager$AppEngineSession.save(SessionManager.java:153)
	at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:41)

So saving SocialAuthManager in the session is not working and seems to be a bad idea. Any workarounds you can suggest, please...

Awaiting your reply...

-Ashwin 

Tarun

unread,
Jun 27, 2011, 10:22:25 AM6/27/11
to socialauth-users

Hi Ashwin

I have emailed you the new jar after resolving this issue.
Otherwise you can take a source code from SVN and make necessary
changes and create a maven build.


Regards
Tarun

Ashwin Prabhu

unread,
Jun 27, 2011, 10:40:35 AM6/27/11
to socialau...@googlegroups.com
That's so nice of you :-) Meanwhile I have already taken a checkout and am directly working with the source instead of the jar. Once I am convinced that everything works on the GAE-J. I shall mail you the diff of changes. So far It's only been some AuthProvider implementations that had their Serializable implementations missing and some FileOutputStream classes (blacklisted) in Base64 creating issues.

I shall get back to you once everything works as per expectations.

Thanks,
Ashwin 

Tarun

unread,
Jun 27, 2011, 10:53:27 AM6/27/11
to socialauth-users
Thanks Ashwin

It will be great if you mail us the required changes to run it on GAE.
We will merged it in our new release.

Regards
Tarun

Ashwin Prabhu

unread,
Jun 27, 2011, 11:40:13 AM6/27/11
to socialau...@googlegroups.com
SocailAuth works perfectly fine on GAE-J after making the following minor changes to the code. 

1. AolImpl, OpenIdImpl and SocialAuthConfig classes need to impliment java.io.Serializable.
2. Completely eliminated java.io.FileOutputStream usage the classes Base64. The methods using File I/O were never referenced elsewhere within the project anyway. 

I have tested this against Gmail, Yahoo, Twitter, Facebook, Hotmail with Permission.AUTHENTICATE_ONLY setting. I cannot vouch for other Permission modes, since I haven't covered those regions of code which pull users social graph and other private stuff, but I don't see why this would not work. 

Thanks Tarun for all your assistance,

You have a well written library with almost 0 learning curve, which makes authentication as simple as it should be :) 

-Ashwin

Raghuram Gururajan

unread,
Dec 1, 2012, 12:09:02 AM12/1/12
to socialau...@googlegroups.com
Can someone share with me the modified jar i am also facing the same problem in GAE

Ken Yee

unread,
Sep 12, 2013, 10:28:24 AM9/12/13
to socialau...@googlegroups.com
Anyone know if these changes were ever folded into the socialauth library code so it works w/ GAE-J?
Reply all
Reply to author
Forward
0 new messages