Single sign in for multistore.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
wooncherk wrote:
In fact if it's across the same domain, just setting the "domain" attribute of "forms" element in web.config is enough.

Try this:

http://tmd1.pronopcommerce.com
http://tmd2.pronopcommerce.com

(feel free to create test users on the site)

and the web.config is:

<forms name="NOPCOMMERCE.AUTH" loginUrl="~/login" protection="All" timeout="43200" path="/" domain="pronopcommerce.com" requireSSL="false" slidingExpiration="true" />


NOTE: I just added doman="pronopcommerce.com".


I understand why this worked for you...because both stores are on same domain..just different subs...
But what if each store has it's own unique domain?
9 years ago
embryo wrote:
Hello-

I just created my second store to run on my nopcommerce instance, and it is working, but when I try to login to it using my login info from store1, nothing happens. I expected to be logged in to store 2, and then if I changed url to store1 domain, that I would also be logged in to it.

But, it does not log me in to either site....just returns me to login screen.

My web.config includes both a forms authentication mode and a machinekey (values hidden for security):

    <authentication mode="Forms">
      <forms name="NOPCOMMERCE.AUTH" domain="mydomain.com" loginUrl="~/login" protection="All" timeout="43200" path="/" requireSSL="false" slidingExpiration="true" />
    </authentication>


    <machineKey compatibilityMode="Framework20SP1" validationKey="################################" decryptionKey="######################################" validation="SHA1" decryption="AES" />

Can you specify both domains in the forms authentication section??
e.g.   domain="mydomain.com,myotherdomain.com"

What am I missing here?

Steve


Hi Steve,

As explained, there is no such thing as cross-domain cookie. Cookie is tied to a single domain, and cannot be shared by 2 or more domains. To enable single sign on (SSO) on multiple domains, you need a workaround as suggested earlier. :)
9 years ago
OK, right...but why can't I even login on store2 at all? My login is an admin on store1...
9 years ago
embryo wrote:
OK, right...but why can't I even login on store2 at all? My login is an admin on store1...


Because you now limit the cookie to Store 1 when you use the following line:

<authentication mode="Forms">
      <forms name="NOPCOMMERCE.AUTH" domain="mydomain.com" loginUrl="~/login" protection="All" timeout="43200" path="/" requireSSL="false" slidingExpiration="true" />
    </authentication>


Now all cookies are only value for mydomain.com and not any other domains. :)
9 years ago
OK..I see..you can't add more than one domain, but if you remove the domain directive, it applies to any domain using this same web.config? OK, thanks!

Has anyone tried this:
http://nfriedly.com/techblog/2010/07/swf-for-javascript-cross-domain-flash-cookies/

I'd be interested in trying it myself, but not sure which page of store2 I'd need to embed the flash object and place the javascript on...maybe in the header or footer?

Steve
9 years ago
Look at this solution for automatically login:
http://www.codeproject.com/Articles/114484/Single-Sign-On-SSO-for-cross-domain-ASP-NET-appl
4 years ago
Did anyone find a solution for nop 4.20?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.