在MVC 4中单点登录 [英] Single Sign On in MVC 4

查看:93
本文介绍了在MVC 4中单点登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用ASP构建的应用程序ABC.NEt Web表单,ABC是我组织中所有小应用程序的父应用程序。



我有另一个应用程序XYZ,这是一个在MVC 4中开发的小应用程序



我需要做的是,



1.当用户登录ABC时,他在ABCGo to XYZ中有一个链接,如果用户点击此链接,他将被重定向到XYZ的主页而无需登录。



2.如果用户想直接去XYZ,他必须在XYZ的登录页面上提供他的凭证



3.但是ABC上的用户会话与XYZ不同,



4.如果用户从XYZ注销,如果会话没有超时,他仍然会在ABC中登录



ABC和XYZ都在不同的服务器上,但身份验证机制相同,使用由javascript调用的WCF服务验证用户凭据。



如何实现这个?



任何有用的代码samlpes,链接,博客..


我计划的是
..



ABC上用户的会话ID保存在会话表的数据库中,XYZ可以访问它。在链接转到XYZ时,一个与ABC的会话ID相关的临时GUID作为XYZ URL的查询字符串参数传递,此临时GUID在10秒后过期。 XYZ使用此GUID在ABC数据库中查找相应的会话ID,如果找到会话,则打开XYZ的主页,在XYZ中为用户创建新会话,会话详细信息将保存在XYZ的本地表中。



请告知此方法是否正确..



提前致谢。

解决方案

作为另一种选择,您可以使用 Windows Azure 构建单点登录应用程序。请阅读以下文章以了解相关信息。



单点登录(使用Windows Azure构建真实云应用程序)



另一个有用的链接:如何在MVC4中实现单点登录



祝你好运! :)

Hi, I have an application ABC built in ASP.NEt Web forms , ABC is the parent application of all small application in my organization.

I have another application XYZ , which is a small application develomed in MVC 4

what I need to do is ,

1. when a user is logged in in ABC , he has a link in ABC "Go to XYZ" , if user click this link he is redirected to home page of XYZ without logging in.

2. If user directly want to go to XYZ the he has to provid his credentials on the login page of XYZ

3. But the session of user on ABC is different from XYZ,

4. If user logged off from XYZ , he will be still logged in in ABC if the session is not timed out

Both ABC and XYZ are on different servers but the authentication machanism is same , user credentials are validated using a WCF service which is being called by javascript.

How to achive this ??

Any useful code samlpes , links , blogs ..

what I am planning is..

The session Id of users on ABC is kept in database in session table , and XYZ has access to it. on clinking the link "Go to XYZ" a temporary GUID which is one to one related with the session id of ABC , is passed as a query string parameter for the XYZ url , this temporary GUID is expired after 10 seconds. XYZ uses this GUID to find the corresponding session ID in the ABC database, and opens the home page of XYZ if the session is found, a new session is created for the user in XYZ and session details will be saved in the local table of XYZ.

Please advice if this approach is correct..

Thanks in advance.

解决方案

As an another option, you can use Windows Azure to build Single Sign-On apps.Please read below article to know about that.

Single Sign-On (Building Real-World Cloud Apps with Windows Azure)

Another useful link : How to Implement Single Sign On in MVC4

Good Luck ! :)


这篇关于在MVC 4中单点登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆