yubrajpokharel / socialauth

Automatically exported from code.google.com/p/socialauth
0 stars 0 forks source link

SocialAuthManager object not getting set in session attribute #306

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.All steps setup on test environment . Able to call facebook in test 
Production environment  has 2 tomcat servers doing load balancing. When we try 
to put socialauthManager in session as an attribute, it doesn't continue. This 
is a jsp page.

SocialAuthConfig config1 =  new SocialAuthConfig();
                config1.setApplicationProperties(System.getProperties()); // to set the key and secret
//Create an instance of SocialAuthManager and set config1
manager = new SocialAuthManager();
manager.setSocialAuthConfig(config1);

String url = manager.getAuthenticationUrl("facebook", successUrl);
session.setAttribute("authManager", manager);  // fails at this line

What is the expected output? What do you see instead?
As working in test with one tomcat server, we should be able to set authmanager 
in session

What version of the product are you using? On what operating system?
latest version

Please provide any additional information below.
2 Tomcatservers with loadsharing is the only clue we can think of.

Please help as this urgent and ready for production release. 

Original issue reported on code.google.com by sudham...@gmail.com on 14 Oct 2013 at 12:10

GoogleCodeExporter commented 8 years ago
Please read Step 5 of the following link
http://www.mulesoft.com/tomcat-clustering

You can search more on google regarding session management in cluster tomcat. 

Regards
Tarun

Original comment by tarun.na...@3pillarglobal.com on 15 Oct 2013 at 11:13

GoogleCodeExporter commented 8 years ago
All the steps mentioned for session management has been done. we are able to 
set a string as a session attribute but not the socialauthManager.
Everytime I place this line in code session.setAttribute("authManager", 
manager); It redirects to error page. 

Original comment by sudham...@gmail.com on 19 Oct 2013 at 10:43

GoogleCodeExporter commented 8 years ago
Using the facebook api (com.facebook.api.*) I am able to set the User object in 
session attribute. (com.restfb.types.User) User is also serializable. So what 
could the problem be with socialAuthManager.

Original comment by sudham...@gmail.com on 19 Oct 2013 at 10:55

GoogleCodeExporter commented 8 years ago
The page redirects to 500.html when I add this line.
SocialAuthManager manager = new SocialAuthManager();
SocialAuthConfig conf = SocialAuthConfig.getDefault();
conf.setApplicationProperties(System.getProperties());
//manager.setSocialAuthConfig(conf);  -- line which causes issue
session.setAttribute("authManager1", manager); // on its own works fine.

Original comment by sudham...@gmail.com on 20 Oct 2013 at 10:54

GoogleCodeExporter commented 8 years ago
Can I pass the socialAuthManager in session with out setting socialAuthConfig.
I already know the config so I can set it even when I come back from page. 

Original comment by sudham...@gmail.com on 20 Oct 2013 at 11:45

GoogleCodeExporter commented 8 years ago
Sometimes log gives missing openid4java-consumer. So I add the dependency jar 
and no error is captured in logs but page throws 500 page error. 
In my test environment I didn't add any of these dependency jars and it was 
working properly.

Original comment by sudham...@gmail.com on 21 Oct 2013 at 9:01

GoogleCodeExporter commented 8 years ago
You should not do that to set config later.

If your ke/secret in oauth_consumer.properties file and it is in your classpath 
then just use

SocialAuthManager manager = new SocialAuthManager();
SocialAuthConfig conf = SocialAuthConfig.getDefault();
conf.load();
manager.setSocialAuthConfig(conf);  -- line which causes issue

Can you please check it is working or not? OR System.getProperties should 
contain all the key/secrets.

Original comment by tarun.na...@3pillarglobal.com on 21 Oct 2013 at 9:07

GoogleCodeExporter commented 8 years ago
I tried loading the properties file but no change. I can't see any error msg

Original comment by sudham...@gmail.com on 21 Oct 2013 at 11:52

GoogleCodeExporter commented 8 years ago
got Caused by: java.lang.ClassNotFoundException: org.openid4java.OpenIDException

Original comment by sudham...@gmail.com on 21 Oct 2013 at 1:23

GoogleCodeExporter commented 8 years ago
Any idea why I get this exception

Caused by: java.lang.ClassNotFoundException: org.openid4java.OpenIDException
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:16
88)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:15
33)

Original comment by sudham...@gmail.com on 22 Oct 2013 at 7:30

GoogleCodeExporter commented 8 years ago
If you are using google provider with latest key then you may get this error.

If you are using google provider then please go through the following link.
http://code.google.com/p/socialauth/issues/detail?id=298

Original comment by tarun.na...@3pillarglobal.com on 29 Oct 2013 at 5:19

GoogleCodeExporter commented 8 years ago
Please open a new issue if problem still persists.

Original comment by tarun.na...@3pillarglobal.com on 24 Dec 2013 at 1:12