Sharing a login between different rails applications.

2 views
Skip to first unread message

Tim Uckun

unread,
Nov 15, 2009, 9:13:54 PM11/15/09
to wellrailed
I am wondering if anybody here has needed something like this before.

I have to two sites. One site is read only for most people (basically
a content site) and the other site is the normal "application" site.
I would like to be able direct people to the content site without
forcing them to log in again. Preferably I would also prefer not to
keep the user information in two databases.

I am thinking maybe some sort of a token passing scheme or another
might do but surely somebody has implemented something like this
already right?

Matt Powell

unread,
Nov 15, 2009, 9:16:37 PM11/15/09
to wellr...@googlegroups.com
How are your subdomains set up, Tim? If (for example) you have www.pimpmytiger.com and app.pimpmytiger.com, you can set your cookie domain to ".pimpmytiger.com" and both sides will share the cookie. As long as it's all one app, most authentication plugins should have no problem with this setup: I am using it successfully with Authlogic.

Hope this helps,
Matt

Tim Uckun

unread,
Nov 15, 2009, 9:42:42 PM11/15/09
to wellr...@googlegroups.com
On Mon, Nov 16, 2009 at 3:16 PM, Matt Powell <faux...@gmail.com> wrote:
>
> How are your subdomains set up, Tim? If (for example) you have www.pimpmytiger.com and app.pimpmytiger.com, you can set your cookie domain to ".pimpmytiger.com" and both sides will share the cookie. As long as it's all one app, most authentication plugins should have no problem with this setup: I am using it successfully with Authlogic.


I have a lot of flexibility in setting up my subdomans (or domains) so
I'll give your suggestion a go.

Did you have to do anything special in your apps like setting a
session token from one app and reading it from the other?

Philip Murray

unread,
Nov 15, 2009, 9:51:06 PM11/15/09
to wellr...@googlegroups.com

On 16/11/2009, at 3:13 PM, Tim Uckun wrote:

If you want to get really serious...

We use the Ruby implementations for CAS (http://www.jasig.org/cas),
across several large discrete systems. Might be a bit overkill for
you, but worth a look

Cheers

Phil

Matt Powell

unread,
Nov 15, 2009, 10:00:23 PM11/15/09
to wellr...@googlegroups.com
I'm only using one app, so I don't have that problem; however, conceivably you might be able to set up two apps with the same session_key -- depending, of course, on your choice of session store.

M

Tim Uckun

unread,
Nov 15, 2009, 10:20:53 PM11/15/09
to wellr...@googlegroups.com
>
> We use the Ruby implementations for CAS (http://www.jasig.org/cas),
> across several large discrete systems. Might be a bit overkill for
> you, but worth a look


Man I wish the world could standardize on something like this. A very
long time ago I was a novell sysadmin and the directory server was so
good. It handled everything, all the novell apps used it, it supported
multi master replication so there was no latency to speak of etc.

Now I find myself maintaining the same users on multiple systems
because the application or the operating system doesn't support X, Y
or C.

Tim Haines

unread,
Nov 15, 2009, 10:28:03 PM11/15/09
to wellr...@googlegroups.com
Hey Tim,

Just wanted to put some emphasis on that . before pimpmytiger.  To share, it does need to be .pimpmytiger.com not just pimpmytiger.com.  Caught me out originally.

Tim.

On Mon, Nov 16, 2009 at 3:16 PM, Matt Powell <faux...@gmail.com> wrote:

Tim Uckun

unread,
Nov 16, 2009, 5:15:09 PM11/16/09
to wellr...@googlegroups.com
On Mon, Nov 16, 2009 at 4:28 PM, Tim Haines <tmha...@gmail.com> wrote:
> Hey Tim,
> Just wanted to put some emphasis on that . before pimpmytiger.  To share, it
> does need to be .pimpmytiger.com not just pimpmytiger.com.  Caught me out
> originally.
> Tim.


Thanks. I'll be careful of it.

Reply all
Reply to author
Forward
0 new messages