emonarafat / socialauth-net

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

Login ->Signout -> login problem #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create STS Provider (I just use Facebook and Google)
2. Login using identity provider
3. Redirected to SP site
4. Sign out from SP Site
5. Successfully sign out 
6. Redirect to SPSite 
7. SPSite redirects to STSProvider login page
8. Clicking on Identity provider Icon or button is not redirecting to Identity 
provider sign in page?

Please look into the enclosed text file for Fiddler info.

What is the expected output? What do you see instead?

STS Provider redirecting to default.aspx with out any query strings.
What version of the product are you using? On what operating system?

Please provide any additional information below.

Please find enclosed text file

Original issue reported on code.google.com by VSYarlag...@dmgov.org on 24 Jul 2012 at 9:13

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Deepak,

Could you please take a look at this ?

Original comment by l...@3pillarglobal.com on 16 Aug 2012 at 11:11

GoogleCodeExporter commented 9 years ago
A possible reason could be that session at STS are not cleaned up andit assumes 
user is already logged in. One thing you could try is to call LogOut() method 
in STS code just before redirecting user to SP. This would force SocialAuth.NET 
to always move up to provider. If user is logged in to that provider, login 
popup won't come up else user will be redirected to provider.
Try this and let us know if this helps.

Deepak

Original comment by daggar...@brickred.com on 18 Aug 2012 at 9:33

GoogleCodeExporter commented 9 years ago
Here is the code which I have modified on STS,  Default.aspx,  Page_PreRender 
event to make sure to logout completely on STS Provider. After I added the 
following, it's working fine.

See the region added in the following section

            else if ( action == WSFederationConstants.Actions.SignOut )
            {
                // Process signout request.
                SignOutRequestMessage requestMessage = (SignOutRequestMessage)WSFederationMessage.CreateFromUri( Request.Url );
                #region Added by VY - To signout completley.
                if (SocialAuthUser.IsLoggedIn())
                {
                    SocialAuthUser saUser = SocialAuthUser.GetCurrentUser();
                    saUser.Logout();
                }
                #endregion
                FederatedPassiveSecurityTokenServiceOperations.ProcessSignOutRequest( requestMessage, User, requestMessage.Reply, Response );
            }

Original comment by VSYarlag...@dmgov.org on 20 Aug 2012 at 1:42

GoogleCodeExporter commented 9 years ago
Glad the solution worked. 
Thanks for updating the post with code change. I'll refer this from FAQ section.
Deepak

Original comment by daggar...@brickred.com on 3 Sep 2012 at 8:47