How can I sync my custom Webflow login with Memberstack to avoid double authentication on Learnworlds?

Post author
Asaad Mahmood

Hey guys, I want to connect my Webflow login done via Memberstack to Learnworlds.

I already added an SSO to learnworld that allows me to login with my memberstack username/pass.

But when I login on my custom login page on my webflow site, it does not log me into https://auth.memberstack.com/interaction/----

And it basically asks me to login again on memberstack... which is definitely not ideal because why should a user login twice to his memberstack profile.

Also just for reference, when I login on my custom login page on my webflow site, I do get the currentMember but not my token.

I was thinking of doing something with the token maybe, but even that's not available.

If I can just login to the official memberstack popover automatically with my custom form, that would be ideal.

Any thoughts?

Comments

11 comments

  • Comment author
    A J

    Hey Asaad Mahmood, I am not familiar with Learnworlds yet, but I was wondering what the setup currently is like for this project.

    Are you setting something up like this but with Learnworlds instead or are you trying to set something like a cross-domain login feature for the sites which share a root domain?

    Some info on how this is setup might help in understanding the goal and current setup.

    0
  • Comment author
    Asaad Mahmood

    Now I’m having an issue where Memberstack keeps asking for me to login even though I’m on the same root domain.
    https://www.loom.com/share/d9dd313fe6bb4ed7862b8d607d829e20

    Please see if someone can help, really bothering my client.
    🔴 P.S: Willing to pay $100 for anyone who can help me fix this issue.

    0
  • Comment author
    Raquel Lopez
    The memberstackConfig object must be declared before calling the Memberstack script
     
    <script> 
    // here add your memberstack config
    </script>
    <script data-memberstack-app="yourid"
    src="https://static.memberstack.com/scripts/v1/memberstack.js"
    type="text/javascript"></script>
    0
  • Comment author
    Asaad Mahmood

    Updated that too, but it doesn’t help, tried a lot of things 🙂

    The problem is, that on one side:
    Webflow: People are logging in via the default webflow memberstack option
    And on
    Learnworlds: People are logging into a memberstack SSO

    Unfortunately when you use the default mechanism (popup or custom form in webflow), it doesn’t seem to be logging you into to memberstack globally so that if you access the SSO from elsewhere, you’re already logged in.

    0
  • Comment author
    Raquel Lopez

    You need to update BOTH sites with the memberstackConfig before declaring the memberstack script. Right now one is taking cookies as a means of authentication, and the other localstorage (default). Both need to use cookies

    Try it and let me know if the issue continues

    Is your Learnwords site authentication being handled by Memberstack as well? or they are handling their own authentication? 🤔

    0
  • Comment author
    Asaad Mahmood

    Its updated on both sides before the memberstack script, I tried multiple ways.
    Both have that cookies script before the memberstackjs script.

    0
  • Comment author
    Raquel Lopez

    Internally, everything is working fine. I can get the member data from both pages without needing to log in again on the other site. The problem is that LearnWorlds authentication and Memberstack authentication are two completely different systems. Their auth tokens aren’t compatible, so logging in with one won’t automatically log you in with the other.

    If both sites used Memberstack for authentication, it would work seamlessly.

    Memberstack’s custom SSO option essentially turns Memberstack into the authentication provider, meaning other apps can log in via Memberstack. But it doesn’t work the other way around. You can’t use a different provider to log in to Memberstack. You can see the list of authorized providers in your Memberstack settings.

    So, the only way to share a session between domains is if both sites use Memberstack as the auth provider and share the same token in their cookies.

    0
  • Comment author
    Asaad Mahmood

    Yeah that’s what I thought too Raquel Lopez

    So doesn’t look like there’s a way to get this to work right?

    0
  • Comment author
    Raquel Lopez

    Sadly there's no simple way around it 😕

    Only maybe, if you're able to force Memberstack on LearnWords, like making all content public and use Memberstack for gating content and authentication, that would be a possibility. But I'm not sure if is possible with LearnWords

    0
  • Comment author
    Asaad Mahmood

    I also thought that, but doesn’t seem like a way to do it, also reached out to learnworlds on this, they recommended setting up a unified authentication mechanism on both platforms.

    0
  • Comment author
    Raquel Lopez

    Memberstack’s only method for creating a valid token/session is through its own login (or via an authorized SSO provider).

    So, to maintain the same session across domains, the user would still need to “pass through” Memberstack at some point.

    One possible workaround would be to create a program that, when switching to LearnWorlds, takes the Memberstack session from the cookie, validates it, and then uses that to create a new LearnWorlds session. The tokens would be different, but the user would be automatically logged in on both platforms.

    However, this wouldn’t work in the opposite direction (LearnWorlds -> Webflow) because Memberstack won’t accept LearnWorlds tokens.

    0

Please sign in to leave a comment.