开发者

Single Sign On with 3 applications

I'm building three web applications in .NET that will all share a users database and login information. Lets pretend that application 1 is the "parent" application and applications "A" and "B" are the "child" applications. All users have to be logged into application 1 to have access to applications A and B.

Authorization, Authentication, and MachineKey sections of all web configs are present and work correctly.

I have the correct web.config settings in all applications to achieve Single Sign On except one problem remains: what do I p开发者_开发知识库ut in the "loginUrl" attribute of the forms tag in Applications A and B.

Assume that the url for the login to application 1 is "www.johnsapp.com/login.aspx" How can I get applications A and B to send the user back to application 1 for authentication using only settings in web.config?


You could use

if (!Request.IsAuthenticated)
    Response.Redirect("~/Login.aspx?ReturnUrl=~/thisurl");

in the Page_Load function of the codebehind. This will redirect automatically.


How about using Windows authentication?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜