Reputation: 1166
I have two applications - one built in Ruby (v1.9.2 I think) on Rails and another simple reporting application built with ASP.Net that is basically a front end to some Reporting Services reports. What I'd like to do is provide a single sign-on type of functionality from the Rails app to the ASP.Net web app. Is there a way this can be done?
Note: I can always pass user information in to the ASP.Net web application via the request using the query string or some such mechanism, but that feels a little dirty.
Upvotes: 4
Views: 182
Reputation: 1858
A simple solution would be to have the two apps on the same domain, but in separate subdomains, e.g.:
And then have a shared cookie (set the cookie domain to .mydomain.com
).
Your ASP.NET application can then check your Rails login app (via a webservice / REST API) to get the user name and login status from the session ID.
Though I also think OAuth is a great way to go, this would work :)
Upvotes: 0
Reputation: 29175
I assume your question relates to 'end user' experience. In this case you should use OAuth. Basically you need to support a following workflow:
Here Rails app will server as OAuth provider and ,net app as an OAuth client.
It may sound as an overkill but this approach has many advantages:
Upvotes: 1