emonarafat / socialauth-net

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

Does not work with any session provider other than InProc #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Because Brickred.SocialAuth.NET.Core.SocialAuthSession is not serializable, 
this module simply doesn't work in a web cluster environment with a load 
balancer without using sticky sessions.

I understand why that is, since the "callback" delegate is not serializable, 
but still, this is a big limitation.

One quick fix would be to mark the class "Brickred.SocialAuth.NET.Core" as 
serializable and add [NonSerialized] to the "callback" property, but I actually 
like the idea of injecting custom logic before logging in the user. It is quite 
useful.

One way around it would be to get rid of the callback altogether and fire a 
static event instead. 

static event EventHandler SocialUserLogin(object sender, EventArgs);

Line 601 of SocialAuthUser would say

if(SocialUserLogin != null)
    SocialUserLogin(this, new EventArgs());

instead of 

SessionManager.ExecuteCallback();

This way, end users could register custom logic to be executed using 
SocialAuthUser.SocialUserLogin += MySocialUserLoginHandler in Global.asax.

Original issue reported on code.google.com by slegay1...@gmail.com on 13 Jan 2012 at 10:08

GoogleCodeExporter commented 9 years ago
Hi, 
Thanks for your detailed description of issue and hint on solution. We'll go 
through this in details and will surely try to resolve this in upcoming 
releases. 

Thanks a lot. 
regards,
Deepak

Original comment by tsg.bric...@gmail.com on 20 Jan 2012 at 11:37

GoogleCodeExporter commented 9 years ago
Any ETA for v 2.4 ?

Original comment by ma...@techknowledge.ae on 14 May 2012 at 6:04

GoogleCodeExporter commented 9 years ago
Hi,

We are targeting a release in next couple of weeks. Any patches that you would 
like to submit as you outlined are most welcome !

Warm regards,
SocialAuth Team

Original comment by l...@brickred.com on 14 May 2012 at 5:32

GoogleCodeExporter commented 9 years ago
Is there any news on a release to include a fix to this web farm related issue?

Original comment by steve.mo...@gmail.com on 31 May 2012 at 10:03

GoogleCodeExporter commented 9 years ago
Yes Steve,

This fix will be released in the SocialAuth-Net-2.3 coming Tuesday.

Warm regards,
SocialAuth team

Original comment by l...@brickred.com on 5 Jun 2012 at 11:13

GoogleCodeExporter commented 9 years ago
Thanks for the update. Presumably you are running a little behind with the 
release so will come back tomorrow.

Original comment by steve.mo...@gmail.com on 6 Jun 2012 at 12:53

GoogleCodeExporter commented 9 years ago
Hi steve,

Actually we meant next Tuesday, i.e. 12th June. Btw, we are also building an 
Android version of Socialauth and will be releasing it some time next week :)

Warm regards
SocialAuth team

Original comment by l...@brickred.com on 6 Jun 2012 at 1:25

GoogleCodeExporter commented 9 years ago
Got you. Thanks for clarification.

Steve

Original comment by steve.mo...@gmail.com on 6 Jun 2012 at 3:39

GoogleCodeExporter commented 9 years ago
On reflection I thought it might help me if I provided a bit more info to you.

Firstly I believe a colleague tested with the suggested fix to the code 
described in the original posting but this didbnt fix the issue in our web 
farm. So it would be good to know if you have simply implemented the 
suggestion, improved on the suggestion or whether your fix is coded from 
scratch.

Additionally it would be good to understand if the fix relies on use of a 
shared SQL session state database.

The web site we want to get this running on has no current usage of SQL session 
state, so we have no set that up. If thats going to be required then it would 
be good to get some advance warning if possible.

Thanks in advance,

Steve

Original comment by steve.mo...@gmail.com on 6 Jun 2012 at 3:44

GoogleCodeExporter commented 9 years ago
Done. Session class made serializable.

Original comment by l...@brickred.com on 16 Jun 2012 at 5:31

GoogleCodeExporter commented 9 years ago
I am not able to get rid of this issue unless i use shared sql session state, 
even after updating latest version of social-auth.net. Am I doing something 
wrong? Kindly suggest!

Original comment by pa...@mhrindia.com on 24 Oct 2012 at 12:06

GoogleCodeExporter commented 9 years ago
Hi Parag,

Could you please provide more details on exception? v2.3 works well for 
different providers.

Deepak

Original comment by daggar...@brickred.com on 25 Oct 2012 at 6:07

GoogleCodeExporter commented 9 years ago
Hi Deepak,
Accessing web app through NLB, gives below error:

[NullReferenceException: Object reference not set to an instance of an object.]
   Brickred.SocialAuth.NET.Core.BusinessObjects.SocialAuthUser.LoginCallback(String response) +488  System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625

When I refresh the page, it gives further error:
[NullReferenceException: Object reference not set to an instance of an object.] 

Brickred.SocialAuth.NET.Core.SocialAuthHttpModule.context_PreRequestHandlerExecu
te(Object sender, EventArgs e) +1867   
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Exec
ute() +79

Setting back to SQL session state resolves the error and I am able to login 
fine.

Thanks for your help!

Original comment by pa...@mhrindia.com on 25 Oct 2012 at 8:03