简体   繁体   English

使用Web服务在ASP.NET和PHP中进行SSO(单点登录)?

[英]SSO(Single Sign-on) in ASP.NET and Php using Webservices?

I'm trying to implement SSO in my asp.net and php site. 我正在尝试在我的asp.net和php网站中实现SSO。 I set up a webservice ~/Webservice.asmx on my asp.net site providing a method called IsUserOnline(string userName) and then I coded php page like 我在asp.net网站上设置了一个webservice〜/ Webservice.asmx,提供了一种称为IsUserOnline(string userName)的方法,然后像

require_once("nusoap/nusoap.php");
$client = new nusoap_client("http://www.myaspnetsite.com/Webservice.asmx?WSDL", "wsdl","", "", "", "");
$err = $client->getError();
if ($err) {
echo "error ..." . $err . ;
}
$param = "username";
$result = $client->call("IsUserOnline", $param, "", "", false, true);

And then I can use result to check if the user is online or not. 然后,我可以使用result来检查用户是否在线。 I can always use the code to check on each php pages or just check it once and create a login status on php site. 我总是可以使用该代码来检查每个php页面,或者只检查一次并在php网站上创建登录状态。 Do you think is it a good solution? 您认为这是一个好的解决方案吗? What's the security issue? 安全问题是什么? The speed issue? 速度问题?

An easiest way of doing SSO between sites is a shared cookie - the only requirement is the same domain (as cookies are shared only in the same domain). 在站点之间进行SSO的最简单方法是共享cookie-唯一的要求是相同的域(因为cookie仅在相同的域中共享)。

Just create a web site responsible for logging users. 只需创建一个负责记录用户的网站。 Let the site create an encrypted cookie upon succesful login. 成功登录后,让网站创建一个加密的cookie。 Then each of your application check whether the cookie exists or not and asks the service to decrypt it and return the user info. 然后,您的每个应用程序都会检查Cookie是否存在,并要求服务对其进行解密并返回用户信息。 Signing out consist in deleting the cookie - all your sites react by logging users out when they try to access pages. 注销包括删除cookie-您的所有站点都会在用户尝试访问页面时通过注销来做出反应。

There are several existing frameworks based on this idea, check JOSSO for example. 有许多基于此思想的现有框架,例如,检查JOSSO。

If you'd rather like to implement an enterprise solution, check the WS-Federation protocol. 如果您想实施企业解决方案,请检查WS-Federation协议。 Its implementation is possible with the Windows Identity Foundation framework. Windows Identity Foundation框架可以实现它。 Just read the "Programming Windows Identity Foundation" book by Vittorio Bertocci and you'll get all the details. 只需阅读Vittorio Bertocci撰写的“ Programming Windows Identity Foundation”一书,您将获得所有详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用PHP表单在ASP.NET / C#中为单点登录(SSO)生成URL? - How to generate URL in ASP.NET / C# for a Single Sign-On (SSO) using PHP form? 单一登录ASP.NET和PHP - Single Sign-On ASP.NET and PHP 如何使用 Microsoft AD 为内部 PHP 应用程序实施单点登录 (SSO)? - How can I implement single sign-on (SSO) using Microsoft AD for an internal PHP app? 使用读取cookie对PHP和ASP.NET进行单点登录 - Single sign on for PHP and ASP.NET using read cookie 单点登录(SSO)如何与PHP + Apache一起针对Active Directory进行透明身份验证? - How does single sign-on (SSO) work with PHP + Apache against an Active Directory for transparent authentication? 对Web应用程序使用单点登录(sso)时的数据库检查(用于凭据),提示? - database check (for credentials) when using single sign-on (sso) for a web app, hint? 通过 PHP 中的单点登录或登录 - Single Sign-on or login via in PHP 为两个PHP网站实施单点登录的策略是什么? - What's the strategy to implement single sign-on for two PHP websites? IBM (ISAM)、单点登录和 PHP Web 应用程序 - IBM (ISAM) , Single Sign-on and a PHP Web App 在ASP.NET中进行安全单点登录,以通过OpenID从其他(php)网站进行身份验证 - Secure Single Sign On in ASP.NET for the authentication from anthother (php) website via OpenID
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM