Right now building an app that authenticates using either email or different social accounts. Because it is going to function on multiple subdomains and domains, I’m wondering if there’s a design pattern that’s been used in the past to accomplish this without issue.
Basically, it’s for authentication only as we are using profile information stored locally. I was originally thinking of doing something like an iframe pointed to accounts.domain.com
that could always check login status of social accounts.
Thanks!
From an architecture point of view, I would think of such a “single sign-on” problem like this:
- Domain has many sub-domains
- User authenticates with Domain, and then uses sub-domains
- User auth token is shared among sub-domains
I imagine that you would have some sort of application level caching in step 2, so that even if say, you have a Google-authenticated user, you would not be hitting Google on every user action. Rather, you would authenticate the user once with Google, then cache the user’s token for some interval and repeat.
You could embed this code in an auth module that could be invoked by the banners of your sites.