且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

怎么办窗体身份验证横跨在asp.net mvc的应用

更新时间:2023-12-01 09:26:10

如果该应用程序在同一个域托管(例如 http://foo.example.com http://bar.example.com ),你可以通过简单的设置在你的web.config身份验证cookie的domain属性和配置同样在执行单一登录机键。该方案在的这篇文章

有关跨域SSO,还有更多工作要做,你可以不使用cookies。因此,从APPA传递给APPB时,你可以发送身份验证令牌值(POST或GET),并有APPB解密,放出自己的域验证cookie。当然,为了解密,这两个应用程序必须配置相同的机器密钥。该方案在的这篇文章

How to do Forms Authentication Across Applications in asp.net mvc

Lets say that two websites www.xyz.com and www.abc.com.

I have to use same user credentials for both the sites. If i redirect one app to another then it wont ask to sign in.

Ask me if u hav any doubt

If the applications are hosted on the same domain (for example http://foo.example.com and http://bar.example.com) you could perform Single Sign On by simply setting the domain property of the authentication cookie in your web.config and configuring the same machine keys. The scenario is detailed in this article.

For cross domain SSO, there's much more to be done as you cannot use cookies. So when passing from AppA to AppB you could send the authentication token value (POST or GET) and have AppB decrypt it and emit an authentication cookie on its own domain. Of course in order to decrypt it, both applications must have the same machine keys configured. The scenario is detailed in this article.