SSO With forms authentication

Mar 5, 2013 at 3:13 PM
Hello,

I'm trying to do SSO with forms authentication, i already set the same forms settings and the same machine key but is not working.

I tried with a blank MVC project and SSO worked fine, but not with near forums.

I've read this disccussion:
http://nearforums.codeplex.com/discussions/396934

Where it says that is not possible, but is from 2011, is it possible now?

I am using SimpleMembership if it changes something.

Thanks
Coordinator
Mar 5, 2013 at 3:20 PM
Hi,
You mean that you configured the same machine key on the 2 web.config files?
Could you answer the following questions?
  1. Is Nearforums configured on another server or in the same server as your main website?
  2. In a subapp (like yoursite.com/forums) or a top level app (like forums.yoursite.com)
  3. Are you running the latest release of Nearforums or you've built your own from the source code?
Kind Regards,
Jorge
Mar 5, 2013 at 3:27 PM
Thanks for the quick response!

Yes i've configured the same machine key, the same cookie name, path and protection.

At the moment, i'm testing on my local machine, I've tested it using iis express and my machine's iis.
So i've tried:
localhost/MyWeb
localhost/NearForums

and with iis express
localhost:2226
localhost:2228

I've built my own from the default branch, i'm going to test it with the v 008 and see if there is some difference.

Thanks
Mar 5, 2013 at 3:36 PM
Thanks for the quick response!

Yes i've configured the same machine key, the same cookie name, path and protection.

At the moment, i'm testing on my local machine, I've tested it using iis express and my machine's iis.
So i've tried:
localhost/MyWeb
localhost/NearForums

and with iis express
localhost:2226
localhost:2228

I've built my own from the default branch, i'm going to test it with the v 008 and see if there is some difference.

Thanks
Coordinator
Mar 5, 2013 at 3:37 PM
Hi,
Yes, use the v8 branch that its stable. The default branch is used for current dev.
We should document it! Sorry for that :)

Kind Regards,
Jorge
Mar 5, 2013 at 5:00 PM
Hi,

I've tested it with in the 008 branch and the same happens.

I have:
<forms
    name=".ASPXFORMSAUTH"
    protection="All"
    path="/"
    timeout="30" />
And:
<machineKey
        validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE"
        decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F"
        validation="SHA1" />
In both projects (in all three in fact).

And if i login from one of my websites it creates the ASPXFORMSAUTH cookie.
But SSO does not work, near forums does take the user as logged in.

And if I log on with near forums, the cookie is replaced, I'm logued out from my website and logged in in near forums.

Do you have any idea about what could be happening?

Is there some sample somewhere of SSO using SimpleMembership?

Thanks!
Coordinator
Mar 6, 2013 at 9:15 AM
Hummm, weird...
The configuration parameters look good.
Nearforums uses the ASP.NET's FormsAuthentication.SetAuthCookie method to set the cookie, so there isn't any magic going on and it is out of our control.
I think its a task for FireCookie!! (The Add on for FireBug).

With firecookie, you will be able to inspect the cookies and to see what is happening. You should try by signin in, deleting the session cookie (loose ASP.NET Session) and refresh the page, on both sides.

:)