Reputation: 4423
I created an application that uses devise for auth. If I wanted to create a completely separate application running on a different server, is there a way to have it use the same auth system as the first application?
Essentially:
System1 System2
------- -------
DB1 DB2
App1 App2
|-model1 |-another model
|-model2 |-yet another model
|-devise <- (Use this auth system)
This way, users that sign up for one application has access to all the applications I develop.
Is this doable in RAILS?
Upvotes: 1
Views: 410
Reputation: 14402
Take a look at OAuth
. With OAuth in place, your first application (the one with Devise) will act as a provider. Other applications (clients) will be able to connect to the provider, login & authorize, and be finally handed back to the client app. You can have as many clients as you want and the user will need to have just a single account on the provider.
There're gems that make this easy, start with Doorkeeper
(provider; see the sample app that uses devise - doorkeeper-provider-app
) and OAuth2
(client).
Upvotes: 1