CN102638454B - A plug-in single sign-on integration method for HTTP authentication protocol - Google Patents
A plug-in single sign-on integration method for HTTP authentication protocol Download PDFInfo
- Publication number
- CN102638454B CN102638454B CN201210067271.XA CN201210067271A CN102638454B CN 102638454 B CN102638454 B CN 102638454B CN 201210067271 A CN201210067271 A CN 201210067271A CN 102638454 B CN102638454 B CN 102638454B
- Authority
- CN
- China
- Prior art keywords
- http
- user
- response
- plug
- identity
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 88
- 230000010354 integration Effects 0.000 title claims abstract description 27
- 230000004044 response Effects 0.000 claims abstract description 230
- 238000012545 processing Methods 0.000 claims abstract description 147
- 230000007246 mechanism Effects 0.000 claims abstract description 34
- 230000006870 function Effects 0.000 claims abstract description 26
- 238000013500 data storage Methods 0.000 claims description 42
- 235000014510 cooky Nutrition 0.000 claims description 40
- 238000013475 authorization Methods 0.000 claims description 34
- 230000008569 process Effects 0.000 claims description 17
- 230000005540 biological transmission Effects 0.000 claims description 5
- 230000008859 change Effects 0.000 claims description 5
- 230000026676 system process Effects 0.000 claims description 3
- 230000009471 action Effects 0.000 claims description 2
- 238000012790 confirmation Methods 0.000 claims description 2
- 238000007781 pre-processing Methods 0.000 claims description 2
- 230000003993 interaction Effects 0.000 abstract description 3
- 238000005516 engineering process Methods 0.000 description 20
- 239000008186 active pharmaceutical agent Substances 0.000 description 5
- 238000011161 development Methods 0.000 description 5
- 230000018109 developmental process Effects 0.000 description 5
- 238000004364 calculation method Methods 0.000 description 4
- 238000007726 management method Methods 0.000 description 4
- 238000013507 mapping Methods 0.000 description 3
- 239000003795 chemical substances by application Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000003860 storage Methods 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000033772 system development Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
Abstract
本发明涉及一种面向HTTP身份鉴别协议的插件式单点登录集成方法,该方法的单点登录系统包括Web服务组件、Web应用组件、单点登录HTTP插件、安全令牌处理页面、浏览器、身份服务系统、主帐户数据库、主从帐户绑定数据库,其中单点登录HTTP插件是关键,它基于Web服务组件提供的扩展机制插入到采用HTTP身份鉴别协议的Web服务组件的HTTP请求、响应处理通道中;当用户在身份服务系统登录后,该插件使用用户在Web应用系统上的帐户名、口令自动完成与Web服务组件的HTTP身份鉴别协议交互,使得用户无需输入Web应用系统中的帐户名、口令即能登录Web应用系统,从而达到单点登录的目的。采用本发明的方法实现单点登录无需改变系统原有的安全配置及功能。
The invention relates to a plug-in single sign-on integration method for HTTP identity authentication protocol, the single sign-on system of the method includes a Web service component, a Web application component, a single sign-on HTTP plug-in, a security token processing page, a browser, Identity service system, master account database, and master-slave account binding database, among which the single sign-on HTTP plug-in is the key, which is inserted into the HTTP request and response processing of the Web service component using the HTTP identity authentication protocol based on the extension mechanism provided by the Web service component In the channel; when the user logs in to the identity service system, the plug-in uses the user's account name and password on the web application system to automatically complete the interaction with the HTTP authentication protocol of the web service component, so that the user does not need to enter the account name in the web application system , password to log in to the web application system, so as to achieve the purpose of single sign-on. Adopting the method of the present invention realizes single sign-on without changing the original security configuration and functions of the system.
Description
技术领域 technical field
本发明属于信息安全的身份鉴别与访问控制技术领域,特别地,是一种面向HTTP身份鉴别协议的插件式单点登录集成方法。The invention belongs to the technical field of identity authentication and access control of information security, in particular, it is a plug-in single sign-on integration method for HTTP identity authentication protocol.
背景技术 Background technique
随着企业电子商务和办公信息化的发展,越来越多的企业、组织机构建立了大量的具有特别用途的信息系统,统称应用系统,如客户关系管理系统、ERP(Enterprise Resource Planning)系统、财务系统、办公自动化系统、电子邮件系统等。这些众多的应用系统在给人们的生产、管理、办公带来方便,提高生产和工作效率的同时,也给人们带来一些困扰,这就是,每个用户必须记住他(或者她)在不同应用系统的帐户名、口令(也称为用户名、口令);这些在不同应用系统的帐户名、口令可能是相同的,也可能是不同的;需要记住、使用众多的不同的帐户名、口令的问题有:1)帐户名、口令管理的困难,如帐户名、口令太多容易混淆、遗忘;2)每次登录不同系统时都需要输入帐户名、口令,给用户带来了不便。针对这一问题,由此产生了所谓的单点登录(Single SignOn,SSO)需求和技术,即用户只需要使用一个身份凭证(如一个帐户名、口令,或一张数字证书等),在某个在线系统完成在线身份鉴别(也即login登录)后就能访问所有其他能够访问的系统,而无需再次输入帐户名、口令或使用数字证书进行身份鉴别(即再进行登录操作)。With the development of enterprise e-commerce and office informatization, more and more enterprises and organizations have established a large number of special-purpose information systems, collectively referred to as application systems, such as customer relationship management systems, ERP (Enterprise Resource Planning) systems, Financial system, office automation system, e-mail system, etc. While these numerous application systems bring convenience to people's production, management, and office, and improve production and work efficiency, they also bring some troubles to people. That is, each user must remember that he (or she) is in different The account name and password of the application system (also known as user name and password); these account names and passwords in different application systems may be the same or different; need to remember, use many different account names, The problem of password has: 1) the difficulty of account name, password management, as account name, password are too many to confuse easily, forget; In response to this problem, the so-called Single Sign On (SSO) requirements and technologies have emerged, that is, users only need to use one identity credential (such as an account name, password, or a digital certificate, etc.), After an online system completes online identity authentication (that is, login), it can access all other systems that can be accessed, without having to enter the account name, password or use digital certificates for identity authentication (that is, to log in again).
目前的各类应用系统大多采用客户机/服务器(Client/Server)的模式,而其中,有的采用基于浏览器(Browser)、Web服务器的标准和通用技术,即采用Browser/Server模式(简称B/S模式),有的采用非标准或非通用的客户端/服务器技术(简称C/S模式)。B/S模式的系统,客户端浏览器与Web服务器之间通过标准的HyperText Transfer Protocol(HTTP)进行数据交互与传送:浏览器将HTTP格式的服务请求(HTTP请求)传送到Web服务器,Web服务器针对请求进行相应处理,之后Web服务器将处理结果以HTTP格式的响应(HTTP响应)返回到浏览器,最后浏览器根据返回的结果数据展现返回的结果内容。HTTP请求由一个请求行(Request Line)、多个可选的头部(Header)和一个可选的主体(Body)组成,其中从请求行和“Host”头部,可以构造出HTTP请求URL(UniformResource Locator);HTTP响应由一个状态行(Status Line)、多个可选的头部(Header)和一个可选的主体(Body)组成。由于B/S模式采用浏览器这种通用客户端以及标准技术架构,易于使用和互操作,是目前信息系统技术发展的主流和趋势,也是本发明针对的应用系统所采用的技术。采用了B/S模式或架构的应用系统称为Web应用系统。Most of the current various application systems adopt the client/server (Client/Server) mode, and some of them adopt the standard and general technology based on the browser (Browser) and Web server, that is, the Browser/Server mode (referred to as B /S mode), and some use non-standard or non-universal client/server technology (referred to as C/S mode). In the B/S mode system, the client browser and the Web server perform data interaction and transmission through the standard HyperText Transfer Protocol (HTTP): the browser transmits the service request (HTTP request) in HTTP format to the Web server, and the Web server The request is processed accordingly, and then the web server returns the processing result to the browser as a response in HTTP format (HTTP response), and finally the browser displays the returned result content according to the returned result data. An HTTP request consists of a request line (Request Line), multiple optional headers (Header) and an optional body (Body). From the request line and the "Host" header, an HTTP request URL ( UniformResource Locator); HTTP response consists of a status line (Status Line), multiple optional headers (Header) and an optional body (Body). Since the B/S mode adopts the common client such as a browser and a standard technical framework, it is easy to use and interoperate, and is the mainstream and trend of the current information system technology development, and it is also the technology adopted by the application system targeted by the present invention. The application system that adopts B/S mode or architecture is called Web application system.
针对B/S模式的Web应用系统的单点登录技术目前常见的有:1)基于Cookie的;2)基于安全网关的;3)基于Windows Kerberos的;4)基于单点登录协议的(标准或自定义协议):5)其他方案。The single sign-on technologies for B/S mode Web application systems are currently common: 1) based on Cookie; 2) based on security gateway; 3) based on Windows Kerberos; 4) based on single sign-on protocol (standard or Custom protocol): 5) Other schemes.
Cookie是Web服务器通过HTTP响应在客户端浏览器中(或客户端主机中)保存的信息,可以包含任何内容,但通常包含用户会话(Session)状态信息。Cookie有作用域,其作用域由域名(Doma in Name)和路径(Path)构成;若HTTP请求的主机域名部分和路径部分在Cookie的作用域内,则浏览器提交的HTTP请求中将包含服务器端设置的Cookie。基于Cookie的单点登录,要求不同信息系统的域名的“基部”相同,比如,若两个信息系统的域名是oa.example.com.cn,crm.example.com.cn,这样它们的“基部”都是example.com.cn,因此,可以实现基于Cookie的单点登录,IBM的LTPA(Lightweight Third Party Authentication)单点登录技术就是基于Cookie的。A cookie is information saved by the web server in the client browser (or in the client host) through an HTTP response. It can contain any content, but usually contains user session (Session) state information. A cookie has a scope, and its scope is composed of a domain name (Doma in Name) and a path (Path); if the host domain name part and path part of the HTTP request are within the scope of the cookie, the HTTP request submitted by the browser will include the server-side Cookies set. Cookie-based single sign-on requires that the "base" of the domain names of different information systems be the same. For example, if the domain names of two information systems are oa.example.com.cn and crm.example.com.cn, their "base" " are all example.com.cn, therefore, cookie-based single sign-on can be achieved, and IBM's LTPA (Lightweight Third Party Authentication) single sign-on technology is based on cookies.
基于安全网关的单点登录,就是采用一个实现安全控制功能的Web反向代理(Reverse Proxy)作为用户访问部署在其后面的不同信息系统、应用系统的关卡(即网关),只有在安全网关完成身份鉴别(即进行成功登录)的用户才能通过安全网关访问部署在其后面的系统,比如IBM的WebSEAL就这样的一个安全网关。这种单点登录技术的最大缺点是,当并发用户访问量很大时,安全网关是性能瓶颈,而且它是潜在的单点失效点(Single Point of Failure)。The single sign-on based on the security gateway is to use a web reverse proxy (Reverse Proxy) that realizes the security control function as the gateway (that is, the gateway) for users to access different information systems and application systems deployed behind it. Users who authenticate (that is, successfully log in) can access the system deployed behind it through the security gateway, such as IBM's WebSEAL, which is such a security gateway. The biggest disadvantage of this single sign-on technology is that when the number of concurrent user visits is large, the security gateway is a performance bottleneck, and it is a potential single point of failure (Single Point of Failure).
基于Windows Kerberos的Web单点登录技术,通过Windows ActiveDirectory,AD)的Kerberos身份鉴别(Authentication)结合HTTPNegotiate协议实现。这种技术方案的局限性在于:1)它需要部署WindowsAD或其他Kerberos系统;2)要求所有用户在AD域上有帐户且用户主机要登录AD域;3)要求所有的Web信息系统、应用系统采用HTTP Negotiate协议进行用户身份鉴别,而且所有Web信息系统、应用系统采用AD域的用户帐户对用户访问进行管理和控制;4)只适合于通过内网访问的信息系统、应用系统。由于这些特别要求,这就限制了基于Windows Kerberos的单点登录解决方案的应用,因为,无论从开发技术角度还是从应用环境的角度,目前的大量Web信息系统、应用系统都不符合这些条件(或者说,不是所有的Web信息系统、应用系统都符合这些条件)。The Web single sign-on technology based on Windows Kerberos is implemented through Kerberos authentication (Authentication) of Windows Active Directory (AD) combined with HTTPNegotiate protocol. The limitations of this technical solution are: 1) It needs to deploy WindowsAD or other Kerberos systems; 2) It requires all users to have accounts in the AD domain and the user host must log in to the AD domain; 3) It requires all Web information systems and application systems The HTTP Negotiate protocol is used for user identity authentication, and all Web information systems and application systems use AD domain user accounts to manage and control user access; 4) It is only suitable for information systems and application systems accessed through the intranet. Due to these special requirements, this limits the application of single sign-on solutions based on Windows Kerberos, because, no matter from the perspective of development technology or application environment, a large number of current Web information systems and application systems do not meet these conditions ( In other words, not all Web information systems and application systems meet these conditions).
针对Web单点登录的协议目前主要有Security Assertion MarkupLanguage(SAML)和WS-Federation Passive Requestor Profile(简称WS-FPRP)。无论是SAML还是WS-FPRP,在其技术架构中都有一个称为Identity Provider(简称IdP)的系统提供在线身份鉴别服务(称为身份服务系统),用户只需(使用浏览器)在IdP完成一次登录(即在线身份鉴别),就能访问该IdP信任域中的其他Web信息系统而无需再进行登录(身份鉴别)操作。但是,这种单点登录技术方案要获得成功应用,有两个关键问题需要解决:一是如何解决用户在不同系统中的帐户之间的对应、转化,二是如何使得已有的各类信息系统、应用系统与单点登录协议集成。所述第一个问题的更具体描述如下:涉及单点登录的各种信息系统、应用系统通常都有各自的用户帐户管理组件和帐户数据库,且这些信息系统、应用系统是基自身的用户帐户来对用户进行访问控制的,这样,用户在IdP进行登录、身份鉴别时所使用的用户帐户与其在某个要访问的信息系统、应用系统中的帐户可能是不相同的(当然也可能相同),因此,当用户在IdP完成身份鉴别后、访问某个应用系统时,需要进行相应的帐户对应、转化,用户才能以其在该应用系统中的帐户(身份)登录、访问该应用系统。The protocols for Web single sign-on currently mainly include Security Assertion Markup Language (SAML) and WS-Federation Passive Requestor Profile (WS-FPRP for short). Whether it is SAML or WS-FPRP, there is a system called Identity Provider (IdP for short) in its technical architecture to provide online identity authentication services (called identity service system), and users only need to (use a browser) in IdP to complete With one login (ie, online identity authentication), you can access other Web information systems in the IdP trust domain without further login (identity authentication) operations. However, for this single sign-on technical solution to be successfully applied, there are two key issues to be solved: one is how to solve the correspondence and conversion between user accounts in different systems, and the other is how to make the existing various information System, application system and single sign-on protocol integration. A more specific description of the first problem is as follows: various information systems and application systems involving single sign-on usually have their own user account management components and account databases, and these information systems and application systems are based on their own user accounts. In this way, the user account used by the user to log in and authenticate at the IdP may be different from the account in an information system or application system to be accessed (of course it may be the same) Therefore, when a user accesses an application system after completing identity authentication at the IdP, corresponding account correspondence and transformation are required, so that the user can log in and access the application system with his account (identity) in the application system.
对于前面所述的第一个问题的常用解决方案是:用户使用一个主帐户在IdP登录,这个主帐户可以是用户已有的某个应用系统帐户,或者是某个已有的全局帐户(如Windows Active Directory中的帐户),或者是某个专门新创建的全局帐户;用户的主帐户事先通过一定的方式同用户在不同信息系统、应用系统的帐户(称为从帐户)关联起来,这个过程称为身份(帐户)关联(Identity Federation或Account Federation)或身份(帐户)绑定(Identity Binding或Account Binding);当用户使用其主帐户在IdP完成登录(身份鉴别)后、访问某个特定应用系统时,其主帐户通过一定的方式被对应、转化成该用户在该应用系统的从帐户,然后用户基于该从帐户访问应用系统,这个主、从帐户对应、转化的过程称为身份(帐户)映射(Identity Mapping或Account Mapping)。A common solution to the first problem mentioned above is: the user uses a primary account to log in to the IdP. This primary account can be an existing application system account of the user, or an existing global account (such as account in Windows Active Directory), or a newly created global account; the user's master account is associated with the user's account (called a secondary account) in different information systems and application systems in a certain way in advance. It is called identity (account) association (Identity Federation or Account Federation) or identity (account) binding (Identity Binding or Account Binding); when a user uses his primary account to log in (identity authentication) in IdP, access a specific application system, its master account is mapped and transformed into the user’s slave account in the application system in a certain way, and then the user accesses the application system based on the slave account. The process of corresponding and transforming the master and slave accounts is called identity (account ) mapping (Identity Mapping or Account Mapping).
所述第二问题实际上涉及到单点登录的集成技术,它是目前单点登录应用中最复杂、最难解决的问题,对这个问题的解决通常有这么几种方案:(1)应用系统的运行平台本身支持相关的单点登录协议(如OracleWebLogic Server的最新版本支持SAML协议),因此,如果应用系统依赖于运行平台来进行登录操作(用户身份鉴别),那么,通过配置运行平台的用户身份鉴别方式,就能通过协议互联实现单点登录;(2)通过修改应用系统的用户登录部分的功能实现,这可能包括修改身份鉴别的相关配置,修改相应的用户登录模块等;(3)通过运行平台提供的身份鉴别扩展机制,如JAAS(Java Authentication and Authorization Service)。The second problem mentioned actually involves the integration technology of single sign-on, which is the most complex and difficult problem in current single sign-on applications. There are usually several solutions to this problem: (1) application system The operating platform itself supports the relevant single sign-on protocol (for example, the latest version of Oracle WebLogic Server supports the SAML protocol). Therefore, if the application system relies on the operating platform for login operations (user identity authentication), then by configuring the user By means of identity authentication, single sign-on can be realized through protocol interconnection; (2) realized by modifying the functions of the user login part of the application system, which may include modifying the relevant configuration of identity authentication, modifying the corresponding user login module, etc.; (3) Through the identity authentication extension mechanism provided by the operating platform, such as JAAS (Java Authentication and Authorization Service).
前面所述的第一种集成解决方案不是在任何情况下都能适用的,因为目前大多数的Web运行平台(Web服务组件、服务器)并不支持相应的单点登录协议。对于第二种解决方案,在很多情况下也不适用,因为,企业、组织机构可能由于各种原因,不愿意或者不能够采用第二种集成解决方案,比如,由于担心修改系统后会对系统的稳定运行带来影响,或者,系统的源代码已不存在(如原系统开发商不愿意配合提供相关的代码,或已倒闭等)。前面所述的第三种方案也不是所有情况都合适,一是因为这种方案通常只适用于应用系统依赖于Web运行平台(Web服务组件、Web服务器)进行身份鉴别的情形(如由Servlet Container对用户进行身份鉴别),不适用于应用系统自身进行用户身份鉴别的情形;二是采用这种机制实现单点登录,通常需要改变平台以前的身份鉴别方式,而有时企业、组织机构由于各种原因不愿意做这种改变(如因为担心这种改变会影响系统的运行或者不安全);三是不是所有Web运行平台都提供了身份鉴别的扩展机制,或者说理论上提供了这种扩展机制,但实际上由于技术上的限制,扩展的身份鉴别机制难以达到与之前的身份鉴别机制同样的功效,比如对于微软IIS(Internet Information Services)Web服务器,其技术文档指出可通过ISAPI(Internet ServiceApplication Programming Interface)扩展IIS的身份鉴别功能,但实际上这种扩展是受限的,比如只能在IIS配置为匿名身份鉴别(AnonymousAuthentication)方式下才能扩展定制的身份鉴别机制,而且由于微软没有公开IIS的内部技术,很难基于ISAPI扩展机制开发出与IIS自身的身份鉴别机制同等功效的单点登录身份鉴别机制。对于其他Web运行平台也都可能会遇到类似的问题。The first integration solution mentioned above is not applicable in any situation, because most of the current web operating platforms (web service components, servers) do not support the corresponding single sign-on protocol. For the second solution, it is not applicable in many cases, because enterprises and organizations may be unwilling or unable to adopt the second integration solution due to various reasons, for example, because they are worried that the system will be damaged after the system is modified. The stable operation of the system is affected, or the source code of the system no longer exists (for example, the original system developer is unwilling to provide relevant code, or has closed down, etc.). The third solution mentioned above is not suitable for all situations. First, this solution is usually only applicable to the situation where the application system relies on the Web operating platform (Web service component, Web server) for identity authentication (such as by Servlet Container User identity authentication) is not applicable to the situation where the application system itself performs user identity authentication; second, to use this mechanism to achieve single sign-on, it usually needs to change the previous identity authentication method of the platform, and sometimes enterprises and organizations due to various The reason is that you are unwilling to make this change (for example, because you are worried that this change will affect the operation of the system or be insecure); third, do all Web operating platforms provide an extension mechanism for identity authentication, or provide this extension mechanism in theory? , but in fact due to technical limitations, it is difficult for the extended identity authentication mechanism to achieve the same effect as the previous identity authentication mechanism. For example, for Microsoft IIS (Internet Information Services) Web server, its technical documentation points out that it can Interface) to extend the identity authentication function of IIS, but in fact this extension is limited. For example, the customized identity authentication mechanism can only be extended when IIS is configured as anonymous authentication (AnonymousAuthentication), and because Microsoft does not disclose IIS Internal technology, it is difficult to develop a single sign-on authentication mechanism with the same effect as IIS's own authentication mechanism based on the ISAPI extension mechanism. Similar problems may also be encountered for other web operating platforms.
在单点登录的实际应用集成中,Web应用系统依赖于Web平台采用标准HTTP身份鉴别协议(如HTTP Basic。Digest,NTLM,Negotiate)进行用户身份鉴别,且Web应用系统的身份鉴别方式不能改变是一种经常遇到的情形,针对这情形,本发明提出另一种思路来解决已有Web应用系统与单点登录技术的集成问题:在不改变系统原有的身份鉴别机制、配置及功能的前提下,通过HTTP插件(Plug-in)技术来实现单点登录。也就是说,在这种单点登录集成方案下,Web运行平台的身份鉴别机制仍然按其原有的方式运行和发挥作用。这里所述的HTTP插件,是指基于Web运行平台提供的扩展机制插入到Web运行平台的HTTP请求、响应处理通道中的一个软件组件,该组件能对通过它的HTTP请求、响应的相关内容进行修改。很多的Web运行平台都提供了这种HTTP插件机制,如微软的IIS服务器的ISAPI,IIS7.0以后的Native-Code API和Managed-CodeAPI,Tomcat Valve、WebLogic的Authentication Filter,WebSphere的Servlet Filter等。In the actual application integration of single sign-on, the Web application system relies on the Web platform to use standard HTTP authentication protocols (such as HTTP Basic, Digest, NTLM, Negotiate) for user identity authentication, and the identity authentication method of the Web application system cannot be changed. A frequently encountered situation, for this situation, the present invention proposes another idea to solve the integration problem of the existing Web application system and single sign-on technology: without changing the original identification mechanism, configuration and function of the system Under the premise, single sign-on is realized through the HTTP plug-in (Plug-in) technology. That is to say, under this single sign-on integration solution, the identity authentication mechanism of the Web operating platform still operates and functions in its original way. The HTTP plug-in mentioned here refers to a software component inserted into the HTTP request and response processing channel of the Web operating platform based on the extension mechanism provided by the Web operating platform. Revise. Many web operating platforms provide this HTTP plug-in mechanism, such as ISAPI of Microsoft's IIS server, Native-Code API and Managed-CodeAPI after IIS7.0, Tomcat Valve, Authentication Filter of WebLogic, Servlet Filter of WebSphere, etc.
发明内容 Contents of the invention
本发明的目的是:针对Web应用系统基于标准HTTP身份鉴别协议对用户进行身份鉴别且这种身份鉴别安全配置不能修改、改变的情形,提出一种面向HTTP身份鉴别协议的插件式单点登录集成方法,以克服现有单点登录集成技术的不足。The purpose of the present invention is to propose a plug-in single sign-on integration for the HTTP identity authentication protocol for the situation that the Web application system authenticates the user based on the standard HTTP identity authentication protocol and the identity authentication security configuration cannot be modified or changed. method to overcome the deficiencies of existing single sign-on integration technologies.
为了实现上述目的,本发明所采用的技术方案是:In order to achieve the above object, the technical solution adopted in the present invention is:
一种面向HTTP身份鉴别协议的插件式单点登录集成方法,所述方法的单点登录系统包括Web服务组件、Web应用组件、单点登录HTTP插件、安全令牌处理页面、浏览器、身份服务系统、主帐户数据库、主从帐户绑定数据库,其中:A plug-in single sign-on integration method for HTTP identity authentication protocol, the single sign-on system of the method includes Web service components, Web application components, single sign-on HTTP plug-ins, security token processing pages, browsers, identity services System, master account database, master-slave account binding database, where:
Web服务组件:为Web应用组件提供HTTP请求接收、响应传送功能,及其他相关的支撑功能,包括:接收用户浏览器提交的HTTP格式的服务请求,进行相应预处理后提交给Web应用组件进行处理,之后,将Web应用组件返回的处理结果,以HTTP响应的格式传送到用户浏览器;基于相应的安全配置,对用户进行身份鉴别、访问控制;维护用户的HTTP会话(Session)等;Web service component: provide HTTP request reception, response transmission function, and other related support functions for Web application components, including: receiving service requests in HTTP format submitted by user browsers, and submitting them to Web application components for processing after corresponding preprocessing After that, the processing result returned by the Web application component is sent to the user's browser in the form of an HTTP response; based on the corresponding security configuration, the user is authenticated and access controlled; the user's HTTP session (Session) is maintained;
Web应用组件:向用户提供特定应用服务的功能软件,如OA、CRM、WebMail等,其主要功能是:通过相应的Web服务组件,接收用户通过浏览器提交的应用服务请求,完成相应处理后将处理结果通过Web服务组件返回到用户浏览器;所述Web应用组件和对应的所述Web服务组件构成了Web应用系统;Web application component: Functional software that provides users with specific application services, such as OA, CRM, WebMail, etc. Its main function is to receive application service requests submitted by users through browsers through corresponding Web service components, and send The processing result is returned to the user's browser through the Web service component; the Web application component and the corresponding Web service component constitute a Web application system;
单点登录HTTP插件:基于Web服务组件提供的扩展机制,插入到采用HTTP身份鉴别协议的Web应用系统的Web服务组件的HTTP请求、响应处理通道中实现单点登录功能的软件组件;Single sign-on HTTP plug-in: Based on the extension mechanism provided by the Web service component, it is inserted into the HTTP request and response processing channel of the Web service component of the Web application system using the HTTP identity authentication protocol to realize the single sign-on function;
安全令牌处理页面:在采用HTTP身份鉴别协议的Web应用系统的Web服务组件上部署的专门处理身份服务系统签发的证明用户身份的安全令牌的Web页面;所述安全令牌处理页面部署在Web服务组的非安全保护路径(目录),即通过浏览器提交HTTP请求到该处理页面的用户无需完成身份鉴别;Security token processing page: a Web page deployed on the Web service component of the Web application system using the HTTP identity authentication protocol to specifically process the security token issued by the identity service system to prove the identity of the user; the security token processing page is deployed on The non-secure protection path (directory) of the Web service group, that is, users who submit HTTP requests to the processing page through the browser do not need to complete identity authentication;
浏览器:用户与Web应用系统交互的客户端,其主要功能是:通过HTTP协议向Web服务组件传送HTTP请求,接收Web服务组件返回的HTTP响应并展现响应的内容;Browser: The client side for the user to interact with the Web application system. Its main functions are: to transmit HTTP requests to the Web service components through the HTTP protocol, receive the HTTP responses returned by the Web service components, and display the content of the responses;
身份服务系统:提供用户在线身份鉴别服务的系统,其功能包括:基于用户身份凭证对用户进行在线身份鉴别,通过相应的单点登录协议并借助浏览器向Web应用系统传送证明用户身份的安全令牌;Identity service system: A system that provides online identity authentication services for users. Its functions include: authenticate users online based on user identity credentials, and send security tokens to prove user identity to the Web application system through the corresponding single sign-on protocol and browser. Card;
主帐户数据库:存放用户登录身份服务系统的主帐户信息,包括主帐户的帐户名、口令,或主帐户对应的数据证书的相关信息;Master account database: stores the master account information of the user logging into the identity service system, including the account name and password of the master account, or information about the data certificate corresponding to the master account;
主从帐户绑定数据库:保存用户主帐户与用户在Web应用系统的从帐户的对应(绑定)关系,以及从帐户的口令。Master-slave account binding database: save the corresponding (binding) relationship between the user's master account and the user's slave account in the Web application system, as well as the password of the slave account.
所述Web服务组件可以是HTTP Web服务器(如IIS)、Web容器(WebContainer,如Tomcat)、J2EE应用服务器(Application Server,如WebLogic、WebSphere);所述Web应用系统通过一定的方式对用户进行身份鉴别,其中部分Web应用系统通过Web服务组件采用标准HTTP身份鉴别协议(如HTTP Basic、HTTP Negotiate)对用户进行身份鉴别;用户访问某个Web应用系统的受保护的页面或资源,需要使用其在该Web应用系统中的相应帐户完成身份鉴别后才能进行;所述Web应用系统可以有多个。Described Web service component can be HTTP Web server (as IIS), Web container (WebContainer, as Tomcat), J2EE application server (Application Server, as WebLogic, WebSphere); Described Web application system carries out identity to user by certain mode Authentication, some of the Web application systems use standard HTTP authentication protocols (such as HTTP Basic, HTTP Negotiate) to authenticate users through Web service components; when users access a protected page or resource of a Web application system, they need to use the The corresponding account in the web application system can only be authenticated; there may be multiple web application systems.
所述单点登录HTTP插件采用的插件机制能够拦截HTTP身份鉴别协议的请求、响应数据(即携带Authorization头部的HTTP请求和携带WWW-Authentication头部的HTTP响应);所述单点登录HTTP插件在其所部署的Web服务组件上被配置为拦截所有的HTTP请求、响应,或者被配置为拦截所有提交到受安全保护的目录或路径的HTTP请求及其响应和提交到安全令牌处理页面所在目录或路径的HTTP请求及其响应。The plug-in mechanism adopted by the single-sign-on HTTP plug-in can intercept the request and response data of the HTTP identity authentication protocol (i.e., the HTTP request carrying the Authorization header and the HTTP response carrying the WWW-Authentication header); the single-sign-on HTTP plug-in It is configured to intercept all HTTP requests and responses on the deployed Web service components, or it is configured to intercept all HTTP requests and their responses submitted to the protected directory or path and submit them to the security token processing page HTTP requests for directories or paths and their responses.
所述单点登录HTTP插件有相应的配置信息,用于设置与单点登录有关的信息,如身份服务系统的用户登录地址(URL)、对安全令牌签名的数字证书等;可选地,配置信息中包含如下内容:1)单点登录HTTP插件所在的Web应用系统中哪些Web页面目录或路径是受安全保护的;2)受安全保护的目录或路径所采用的HTTP身份鉴别协议是哪个或哪些(即可以设置多个),及相关的身份鉴别协议参数(如domain、realm等);3)所使用的HTTP身份鉴别的具体实施是否允许客户端主动发出鉴别和授权请求。所述配置信息3)是针对这样的情形:有的HTTP身份鉴别协议(如HTTP Negotiate)允许客户端浏览器在初次访问受保护的资源时候,在Web服务器端返回要求身份鉴别的响应提示前,也即在客户端浏览器接收到响应状态码是“401”(提示Unauthorized或Authentication required)且包含WWW-Authenticate头部的HTTP响应之前,由客户端浏览器主动发起身份鉴别过程,即主动提交包含Authorization头部的HTTP请求,请求服务器端对客户端用户进行身份鉴别和对资源访问进行授权;但是,某个Web组件的具体协议实施也许并不支持这种客户端主动发起身份鉴别的方式,该配置信息即用于对此进行指示。所述内容1)、2)通常可通过一定的方式,如API、配置文件读取,从Web服务组件获得,但在无法获得请求下,可通过单点登录HTTP插件的配置信息设置并获得。The single sign-on HTTP plug-in has corresponding configuration information for setting information related to single sign-on, such as the user login address (URL) of the identity service system, the digital certificate signed by the security token, etc.; optionally, The configuration information includes the following content: 1) which web page directories or paths in the web application system where the single sign-on HTTP plug-in is located are protected by security; 2) which HTTP authentication protocol is used by the directories or paths protected by security or which (that is, multiple can be set), and related identity authentication protocol parameters (such as domain, realm, etc.); 3) whether the specific implementation of HTTP identity authentication used allows the client to actively issue authentication and authorization requests. The configuration information 3) is aimed at such a situation: some HTTP identity authentication protocols (such as HTTP Negotiate) allow the client browser to access the protected resource for the first time, before the Web server side returns a response prompt requiring identity authentication, That is, before the client browser receives an HTTP response with a response status code of "401" (prompting Unauthorized or Authentication required) and including the WWW-Authenticate header, the client browser actively initiates the identity authentication process, that is, actively submits the HTTP response containing The HTTP request in the Authorization header requests the server to authenticate the client user and authorize resource access; however, the specific protocol implementation of a certain web component may not support this method of the client actively initiating identity authentication. Configuration information is used to indicate this. The content 1) and 2) can usually be obtained from the Web service component through a certain method, such as API and configuration file reading, but if the request cannot be obtained, it can be set and obtained through the configuration information of the single sign-on HTTP plug-in.
所述身份服务系统签发的所述安全令牌的格式依赖于使用的单点登录协议,可以是SAML断言(Assertion),或者WS-Federation安全令牌(Security Token),或者自定义的安全令牌;所述身份服务系统通过数字签名保证所签发的安全令牌的安全性(原发性、完整性)。The format of the security token issued by the identity service system depends on the single sign-on protocol used, and can be a SAML assertion (Assertion), or a WS-Federation security token (Security Token), or a custom security token ; The identity service system guarantees the security (originality, integrity) of the security token issued by the digital signature.
用户在所述身份服务系统进行在线身份鉴别时所用的身份凭证,可以是普通帐户名、口令,也可以是数字证书,或者其他能够标识、验证用户身份的其他电子身份数据。用户在所述身份服务系统进行身份鉴别时使用的帐户称为主帐户。所述主帐户数据库是用于保存用户主帐户及相关信息的数据库,所述主帐户数据库可以是独立的帐户数据库,也可以选择某个应用系统的用户帐户数据库作为主帐户数据库。所述从帐户即指用户在某个特定Web应用系统的帐户;用户的主帐户与其在某个Web应用系统中的从帐户可以是同一个,也可以不同。The identity credential used by the user for online identity authentication in the identity service system may be a common account name, password, digital certificate, or other electronic identity data capable of identifying and verifying the identity of the user. The account used by the user for identity authentication in the identity service system is called the main account. The master account database is a database for storing user master accounts and related information. The master account database may be an independent account database, or a user account database of an application system may be selected as the master account database. The secondary account refers to the user's account in a specific web application system; the user's main account and the secondary account in a certain web application system may be the same or different.
所述单点登录HTTP插件保存有每个用户的登录(身份鉴别)相关信息,称为用户登录信息。所述用户登录信息包括:The single sign-on HTTP plug-in stores login (identity authentication) related information of each user, which is called user login information. The user login information includes:
1)身份鉴别协议,即Web服务组件当前使用的、用于对用户进行身份鉴别的HTTP身份鉴别协议;1) Identity authentication protocol, that is, the HTTP identity authentication protocol currently used by Web service components for authenticating users;
2)服务器端返回协议数据与参数,即Web服务组件使用HTTP身份鉴别协议对客户端用户进行身份鉴别时,通过WWW-Authentucate响应头部返回到客户端浏览器的协议相关数据和参数,如HTTP身份鉴别协议指示及Realm、Challenge(挑战码)、密钥协商参数等,其中HTTP身份鉴别协议指示在“身份鉴别协议”中也同时保存;2) The server side returns protocol data and parameters, that is, when the Web service component uses the HTTP identity authentication protocol to authenticate the client user, the protocol-related data and parameters returned to the client browser through the WWW-Authentucate response header, such as HTTP Identity authentication protocol instructions and Realm, Challenge (challenge code), key negotiation parameters, etc., wherein the HTTP identity authentication protocol instructions are also stored in the "identity authentication protocol" at the same time;
3)最近一次要访问的受保护的URL,即用户在Web应用系统完成身份鉴别前,使用浏览器最近一次期望访问的受安全保护的Web页面的URL;3) The protected URL to be accessed last time, that is, the URL of the protected Web page that the user expects to visit last time using the browser before the Web application system completes identity authentication;
4)最近一次POST参数,用户在Web应用系统完成身份鉴别前,若使用浏览器最近一次访问受安全保护的Web页面时使用的HTTP请求方法(Method)是POST,则“最近一次POST参数”的值是该HTTP请求对应的POST参数(即POST方式提交的Form表单数据),否则其值是空(NULL);4) The latest POST parameter. Before the user completes the identity authentication in the web application system, if the HTTP request method (Method) used when using the browser to access the securely protected web page last time is POST, the "last POST parameter" The value is the POST parameter corresponding to the HTTP request (that is, the Form form data submitted by POST), otherwise its value is empty (NULL);
5)用户身份信息,标识和鉴别用户的信息,包括用户的主帐户名、从帐户名及从帐户口令;5) User identity information, information that identifies and authenticates the user, including the user's primary account name, secondary account name, and secondary account password;
以上所述各种用户登录信息以字符串的形式保存(对于非字符数据,以Base64编码的格式保存);所述“用户身份信息”被加密且具有时效性,以防止泄露和重播攻击;所述“身份鉴别协议”、“最近一次要访问的受保护的URL”、“最近一次POST参数”和“用户身份信息”保存在Cookie中,且该Cookie的作用路径需要同时包含Web服务组件设置的受安全保护的路径和安全令牌处理页面所在非受安全保护的路径,即无论在受安全保护的路径中的Web页面还是非受安全保护的安全令牌处理页面都能查看得到该Cookie,或者,将有关的用户登录信息同时保存在两个不同的Cookie中,其中一个的作用路径是受安全保护的路径,另一是非受安全保护的安全令牌处理页面所在路径。The various user login information mentioned above are stored in the form of character strings (for non-character data, stored in Base64 encoded format); the "user identity information" is encrypted and time-sensitive to prevent leaks and replay attacks; The "identity authentication protocol", "the last protected URL to be accessed", "the last POST parameter" and "user identity information" are stored in the cookie, and the action path of the cookie needs to include the settings set by the web service component at the same time. The secure path and the non-secure path where the security token processing page is located, that is, the cookie can be viewed regardless of the web page in the secure path or the non-secure security token processing page, or , save the relevant user login information in two different cookies at the same time, one of which is the path protected by security, and the other is the path where the security token processing page is not protected by security.
单点登录HTTP插件根据Web服务组件提供给HTTP插件的数据存储机制的不同,依如下优先顺序,分别按如下方法对用户登录信息中的相关信息进行存储:The single sign-on HTTP plug-in stores the relevant information in the user login information according to the following priority order according to the different data storage mechanisms provided by the Web service component to the HTTP plug-in:
1)若Web服务组件向HTTP插件提供了基于TCP连接(Connection)的数据存储位置,则单点登录HTTP插件将“服务器端返回协议数据与参数”保存在基于TCP连接的数据存储位置,将其他信息通过Cookie保存在客户端浏览器中;或者,1) If the Web service component provides the HTTP plug-in with a data storage location based on the TCP connection (Connection), then the single sign-on HTTP plug-in will save the "server-side return protocol data and parameters" in the data storage location based on the TCP connection, and save other The information is saved in the client browser through cookies; or,
2)若Web服务组向HTTP插件提供了基于HTTP会话(Session)的数据存储位置,则单点登录HTTP插件将“服务器端返回协议数据与参数”保存在基于HTTP会话的数据存储位置,将其他信息通过Cookie保存在客户端浏览器中;或者,2) If the Web service group provides the HTTP plug-in with a data storage location based on the HTTP session (Session), then the single sign-on HTTP plug-in will save the "server-side return protocol data and parameters" in the data storage location based on the HTTP session, and save other The information is saved in the client browser through cookies; or,
3)若单点登录HTTP插件有定制开发的基于TCP连接或HTTP会话的数据存储位置,则单点登录HTTP插件将“服务器端返回协议数据与参数”保存在定制开发的基于TCP连接或HTTP会话的数据存储位置,将其他信息通过Cookie保存在客户端浏览器中;3) If the single sign-on HTTP plug-in has a custom-developed data storage location based on TCP connection or HTTP session, then the single-sign-on HTTP plug-in will save the "server-side return protocol data and parameters" in the custom-developed TCP connection or HTTP session-based The data storage location, save other information in the client browser through cookies;
否则,otherwise,
4)单点登录HTTP插件将所有用户登录信息通过Cookie保存在客户端浏览器中。4) The single sign-on HTTP plug-in saves all user login information in the client browser through cookies.
所述基于TCP连接的数据存储位置,指Web服务组件向HTTP插件提供的数据存储位置与HTTP数据传输的TCP连接相关联,TCP连接不同,则提供的数据存储位置不同(如IIS向ISAPI Filter提供的基于TCP连接的数据存储位置);所述基于HTTP会话的数据存储位置指:只要是同一HTTP会话,即便TCP连接不同,数据存储位置仍然相同,即数据存储位置与TCP连接无关,仅与特定的HTTP用户会话有关,这种HTTP会话数据存储机制通常用Cookie中存放的特定标识来区分不同的会话,并将会话数据保存在Web服务器(组件)中,如Java Web容器向Servlet Filter提供的存放数据的Session对象就是这种情况。The data storage location based on the TCP connection refers to that the data storage location provided by the Web service component to the HTTP plug-in is associated with the TCP connection of the HTTP data transmission. If the TCP connection is different, the data storage location provided is different (such as IIS provides to the ISAPI Filter The data storage location based on the TCP connection); the data storage location based on the HTTP session refers to: as long as it is the same HTTP session, even if the TCP connection is different, the data storage location is still the same, that is, the data storage location has nothing to do with the TCP connection, but only with a specific This HTTP session data storage mechanism usually uses the specific identifier stored in the cookie to distinguish different sessions, and saves the session data in the Web server (component), such as the storage provided by the Java Web container to the Servlet Filter. This is the case for the Session object of the data.
针对所述“服务器端返回协议数据与参数”,在单点登录HTTP插件的配置信息中必须设定如下内容:对于Web应用系统使用的每一个HTTP身份鉴别协议,在用户身份鉴别成功后,“服务器端返回协议数据与参数”的值的相应设置方式,设置方式的选项是:保持不变,设置为空(NULL),或设置为一个空格(Space)。For the "server-side return protocol data and parameters", the following content must be set in the configuration information of the single sign-on HTTP plug-in: For each HTTP identity authentication protocol used by the web application system, after the user identity authentication is successful, " The corresponding setting method for the value of "Protocol Data and Parameters Returned by the Server". The options for the setting method are: keep unchanged, set to NULL, or set to a space (Space).
当用户使用浏览器访问某个使用HTTP身份鉴别协议对用户进行身份鉴别的Web应用系统时,所述单点登录HTTP插件拦截HTTP请求,然后按如下方式对HTTP请求进行处理:When a user uses a browser to access a web application system that uses the HTTP authentication protocol to authenticate the user, the single sign-on HTTP plug-in intercepts the HTTP request, and then processes the HTTP request as follows:
A1.根据相关配置信息,确定当前HTTP请求URL对应的是受安全保护的页面还是非受安全保护的页面,若是受安全保护的,则转入下一步骤;否则,让该HTTP请求通过,完成本次HTTP请求处理;A1. According to the relevant configuration information, determine whether the current HTTP request URL corresponds to a page protected by security or a page not protected by security. If it is protected by security, go to the next step; otherwise, let the HTTP request pass and complete This HTTP request processing;
A2.检查“服务器端返回协议数据与参数”,若其没有设置或其值为空,则转入下一步骤;否则,转入步骤A6;A2. Check the "server-side return protocol data and parameters", if it is not set or its value is empty, then go to the next step; otherwise, go to step A6;
A3.检查“用户身份信息”,若其存在且有效,则转入下一步骤;否则,让HTTP请求通过,完成本次HTTP请求处理;A3. Check the "user identity information", if it exists and is valid, then go to the next step; otherwise, let the HTTP request pass and complete the HTTP request processing;
A4.从Cookie中保存的“身份鉴别协议”信息中得到Web应用系统当前使用的HTTP身份鉴别协议,然后,根据相关配置信息确定所采用的HTTP身份鉴别协议是否允许客户端主动发出鉴别和授权请求,若不允许,则让HTTP请求通过,完成本次HTTP请求处理;否则,继续;A4. Obtain the HTTP authentication protocol currently used by the Web application system from the "identity authentication protocol" information stored in the cookie, and then determine whether the adopted HTTP authentication protocol allows the client to actively issue authentication and authorization requests according to the relevant configuration information , if not allowed, let the HTTP request pass through and complete the HTTP request processing; otherwise, continue;
A5.从相关配置信息中获得HTTP身份鉴别协议所需的数据与参数(如realm参数),依HTTP身份鉴别协议,生成客户端初次提交的包含身份鉴别数据的Authorization请求头部,并将生成的头部加入到拦截的HTTP请求中,然后,让修改后的HTTP请求通过,完成本次HTTP请求处理;A5. Obtain the data and parameters (such as realm parameters) required by the HTTP identity authentication protocol from the relevant configuration information, and generate the Authorization request header containing the identity authentication data submitted by the client for the first time according to the HTTP identity authentication protocol, and send the generated The header is added to the intercepted HTTP request, and then the modified HTTP request is passed to complete the HTTP request processing;
A6.若“服务器端返回协议数据与参数”的值为一个空格,则让该HTTP请求通过,完成本次HTTP请求处理;否则,继续;A6. If the value of "server-side return protocol data and parameters" is a space, let the HTTP request pass and complete the HTTP request processing; otherwise, continue;
A7.根据“服务器端返回协议数据与参数”中的HTTP身份鉴别协议及其他数据,生成HTTP身份鉴别协议在当前协议阶段的Authorization请求头部,并将生成的头部加入到拦截的HTTP请求中,然后,让修改后的HTTP请求通过,完成本次HTTP请求处理。A7. According to the HTTP authentication protocol and other data in "Server-side return protocol data and parameters", generate the Authorization request header of the HTTP authentication protocol at the current protocol stage, and add the generated header to the intercepted HTTP request , and then, let the modified HTTP request pass to complete the HTTP request processing.
所述步骤A1、A4、A5中所述相关配置信息指Web服务组件和/或单点登录HTTP插件的与安全访问控制、身份鉴别、单点登录有关的配置信息;所述单点登录HTTP插件或者通过Web服务组件提供的相应接口查询Web服务组件的相关配置信息,或者直接读取相关配置文件。The relevant configuration information described in the steps A1, A4, and A5 refers to the configuration information related to security access control, identity authentication, and single sign-on of the Web service component and/or single-sign-on HTTP plug-in; the single-sign-on HTTP plug-in Either query the relevant configuration information of the Web service component through the corresponding interface provided by the Web service component, or directly read the relevant configuration file.
所述HTTP身份鉴别协议的身份鉴别过程可能需要客户端与服务器端通过HTTP请求、响应进行多个步骤或阶段的交互,而所述步骤A7中所述的HTTP身份鉴别协议的“当前协议阶段”是指客户端根据身份鉴别协议当前所处的步骤或阶段;HTTP身份鉴别协议的“当前协议阶段”决定了HTTP请求的当前Authorization头部的数据内容是什么;客户端可根据服务器端返回的协议数据与参数,确定当前所处的步骤或阶段。The identity authentication process of the HTTP identity authentication protocol may require the client and the server to interact in multiple steps or stages through HTTP requests and responses, and the "current protocol stage" of the HTTP identity authentication protocol described in step A7 Refers to the current step or stage of the client according to the identity authentication protocol; the "current protocol stage" of the HTTP identity authentication protocol determines what the data content of the current Authorization header of the HTTP request is; the client can follow the protocol returned by the server Data and parameters to determine the current step or stage.
所述单点登录HTTP插件在HTTP请求处理阶段的所述步骤A5、A7,根据HTTP身份鉴别协议的不同,分别按如下方式,产生HTTP身份鉴别协议在对应协议阶段的相应Authorization请求头部:In the steps A5 and A7 of the HTTP request processing stage of the single sign-on HTTP plug-in, according to the difference of the HTTP identity authentication protocol, the corresponding Authorization request header of the HTTP identity authentication protocol in the corresponding protocol stage is generated in the following manner:
情形1.1.若HTTP身份鉴别协议是HTTP Basic,则从Cookie中解密“用户身份信息”数据、获取用户在Web应用系统中的从帐户名、口令,然后按HTTP Basic协议的要求,形成Authorization头部;否则,Situation 1.1. If the HTTP authentication protocol is HTTP Basic, decrypt the "user identity information" data from the cookie, obtain the user's secondary account name and password in the Web application system, and then form the Authorization header according to the requirements of the HTTP Basic protocol ;otherwise,
情形1.2.若HTTP身份鉴别协议是HTTP Digest,则从Cookie中解密“用户身份信息”数据、获取用户在Web应用系统中的从帐户名、口令,然后根据“服务器端返回协议数据与参数”中的内容,以及HTTP Digest协议的要求,形成Authorization头部;否则,Situation 1.2. If the HTTP authentication protocol is HTTP Digest, then decrypt the "user identity information" data from the cookie, obtain the user's secondary account name and password in the web application system, and then according to the "server-side return protocol data and parameters" content, and the requirements of the HTTP Digest protocol, form the Authorization header; otherwise,
情形1.3.若HTTP身份鉴别协议是HTTP NTLM,且“服务器端返回协议数据与参数”为未设置或者其值为空或者其值为进行身份鉴别的初次提示,则产生NTLM Type 1数据,然后按HTTP NTLM协议要求,形成Authorization头部的数据;否则,先从Cookie中解密“用户身份信息”数据、获取用户在Web应用系统中的从帐户名、口令,然后,利用该从帐户名、口令以及保存在“服务器端返回协议数据与参数”中的相关数据(即NTLM Type 2数据),产生NTLM Type 3数据,然后按HTTP NTLM协议要求,形成Authorization头部;否则,Situation 1.3. If the HTTP authentication protocol is HTTP NTLM, and the "server-side return protocol data and parameters" is not set or its value is empty or its value is the initial prompt for identity authentication, then generate NTLM Type 1 data, and then press The HTTP NTLM protocol requires to form the data in the Authorization header; otherwise, first decrypt the "user identity information" data from the cookie, obtain the user's secondary account name and password in the Web application system, and then use the secondary account name, password and Relevant data (that is, NTLM Type 2 data) stored in the "server-side return protocol data and parameters" generates NTLM Type 3 data, and then forms the Authorization header according to the HTTP NTLM protocol requirements; otherwise,
情形1.4.若HTTP身份鉴别协议是HTTP Negotiate,则先从Cookie中解密“用户身份信息”数据、获取用户在Web应用系统中的从帐户名、口令(即在Kerberos系统中,如Windows AD中,的帐户名、口令),然后利用该从帐户名、口令调用相应的Kerberos接口,连接Kerberos KDC(Key Distribution Center)的Authentication Server(身份鉴别服务器),获得用户的TGT(Ticket-Granting Ticket),然后再使用该TGT调用GSS-API或相当的接口(如Windows SSPI),获得用户访问Web应用系统的Spnego Token,然后,利用获得的Spnego Token,按HTTP Negotiate协议要求,形成Authorization头部;否则,Situation 1.4. If the HTTP authentication protocol is HTTP Negotiate, then first decrypt the "user identity information" data from the cookie, and obtain the user's account name and password in the Web application system (that is, in the Kerberos system, such as Windows AD, account name, password), and then use the slave account name, password to call the corresponding Kerberos interface, connect Kerberos KDC (Key Distribution Center) Authentication Server (identity authentication server), obtain the user's TGT (Ticket-Granting Ticket), and then Then use the TGT to call GSS-API or an equivalent interface (such as Windows SSPI) to obtain the Spnego Token for the user to access the Web application system, and then use the obtained Spnego Token to form the Authorization header according to the requirements of the HTTP Negotiate protocol; otherwise,
情形1.5:若是其他有效的HTTP身份鉴别协议,则按相关协议进行处理;否则,将用户浏览器引导到出错页面。Situation 1.5: If it is another valid HTTP identity authentication protocol, process it according to the relevant protocol; otherwise, guide the user browser to an error page.
所述单点登录HTTP插件在HTTP请求处理阶段完成所述步骤A2-7的相关处理后,让HTTP请求通过前,需做如下处理操作:若当前HTTP请求的URL与“最近一次要访问的受保护的URL”中保存的URL相同且当前HTTP请求的方法是GET且“最近一次POST参数”的值非空,则将当前HTTP请求的方法改为POST,将“最近一次POST参数”中的数据作为POST参数添加到当前HTTP请求中。After the single sign-on HTTP plug-in completes the relevant processing of the steps A2-7 in the HTTP request processing stage, before allowing the HTTP request to pass, the following processing operations need to be performed: If the URL of the current HTTP request is the same as the "recently The URL saved in "Protected URL" is the same and the method of the current HTTP request is GET and the value of the "last POST parameter" is not empty, then the method of the current HTTP request is changed to POST, and the data in the "last POST parameter" Added as a POST parameter to the current HTTP request.
当所述单点登录HTTP插件拦截HTTP响应后,按如下方式对HTTP响应进行处理:After the single sign-on HTTP plug-in intercepts the HTTP response, the HTTP response is processed as follows:
B1.检查HTTP响应的响应状态及头部,如果响应状态码是“401”(提示Unauthorized或Authentication required)且包含WWW-Authenticate响应头部,则转入下一步骤;否则,转入B7;B1. check the response status and header of the HTTP response, if the response status code is "401" (prompt Unauthorized or Authentication required) and include the WWW-Authenticate response header, then proceed to the next step; otherwise, proceed to B7;
B2.检查“用户身份信息”,若其存在且有效,则转入一下步;否则,转入B6;B2. Check the "user identity information", if it exists and is valid, then go to the next step; otherwise, go to B6;
B3.检查当前HTTP响应的WWW-Authenticate头部的值,若是进行身份鉴别的初始提示且响应对应的HTTP请求包含有Authorization头部且该Authorization头部的值是所述WWW-Authenticate头部中指示的HTTP身份鉴别协议对应的身份凭证数据或者经身份凭证数据密码运算后的数据,则转入下一步骤;否则,转入步骤B5;B3. Check the value of the WWW-Authenticate header of the current HTTP response, if it is an initial prompt for identity authentication and the corresponding HTTP request in response contains an Authorization header and the value of the Authorization header is indicated in the WWW-Authenticate header The identity credential data corresponding to the HTTP identity authentication protocol or the data after the identity credential data password calculation is then transferred to the next step; otherwise, it is transferred to step B5;
B4.将“用户身份信息”设置为空,将“服务器端返回协议数据与参数”的值设置为HTTP响应的WWW-Authenticate头部的值,获取当前HTTP响应对应的HTTP请求URL,将其作为“最近一次要访问的受保护的URL”的值保存;若当前HTTP响应对应的HTTP请求的方法是POST,则将该请求对应的POST参数(即Form表单数据)保存到“最近一次POST参数”中,否则将“最近一次POST参数”的值设置为空;然后,将HTTP响应的响应状态码修改为“302”,将WWW-Authenticate响应头部去掉,将可能包含的HTTP响应主体(Body)及响应主体长度指示去掉,在响应中加入Location头部,将其值设置为身份服务系统的用户代登录出错页面URL,该URL通过Query String附加了单点登录HTTP插件所在的Web应用系统的系统标识,最后,让修改后的HTTP响应通过,完成本次HTTP响应的处理;B4. Set "user identity information" to empty, set the value of "server-side return protocol data and parameters" to the value of the WWW-Authenticate header of the HTTP response, obtain the HTTP request URL corresponding to the current HTTP response, and use it as The value of the "protected URL to be accessed last time" is saved; if the method of the HTTP request corresponding to the current HTTP response is POST, then the POST parameter (ie Form form data) corresponding to the request is saved to the "last POST parameter" Otherwise, set the value of "Last POST parameter" to empty; then, change the response status code of the HTTP response to "302", remove the WWW-Authenticate response header, and replace the HTTP response body (Body) that may be included And the length indication of the response body is removed, the Location header is added to the response, and its value is set to the URL of the user agent login error page of the identity service system. The URL is appended with the system of the web application system where the single sign-on HTTP plug-in is located through the Query String mark, and finally, let the modified HTTP response pass to complete the processing of this HTTP response;
B5.将“服务器端返回协议数据与参数”的值设置为HTTP响应的WWW-Authenticate头部的值,获取当前HTTP响应对应的HTTP请求URL并将其作为“最近一次要访问的受保护的URL”的值保存;若当前HTTP响应对应的HTTP请求的方法是POST,则将该请求对应的POST参数保存到“最近一次POST参数”中,否则将“最近一次POST参数”的值设置为空;然后,将HTTP响应的响应状态码修改为“302”,将WWW-Authenticate响应头部去掉,将可能包含的HTTP响应主体(Body)及响应主体长度指示去掉,在响应头部中加入Location头部,将其值设置为当前HTTP响应对应的HTTP请求URL,然后,让修改后的HTTP响应通过,完成本次HTTP响应的处理;B5. Set the value of "server-side return protocol data and parameters" to the value of the WWW-Authenticate header of the HTTP response, obtain the HTTP request URL corresponding to the current HTTP response and use it as "the last protected URL to be accessed "; if the method of the HTTP request corresponding to the current HTTP response is POST, save the POST parameter corresponding to the request into the "last POST parameter", otherwise set the value of the "last POST parameter" to empty; Then, modify the response status code of the HTTP response to "302", remove the WWW-Authenticate response header, remove the possible HTTP response body (Body) and the length indication of the response body, and add the Location header to the response header , set its value to the HTTP request URL corresponding to the current HTTP response, and then pass the modified HTTP response to complete the processing of this HTTP response;
B6.将WWW-Authenticate头部中指示的HTTP身份鉴别协议保存到所述用户登录信息的所述“身份鉴别协议”中,将“用户身份信息”设置为空,将“服务器端返回协议数据与参数”的值设置为HTTP响应的WWW-Authenticate头部的值,获取当前HTTP响应对应的HTTP请求URL,将其作为“最近一次要访问的受保护的URL”的值保存;若当前HTTP响应对应的HTTP请求的方法是POST,则将该请求对应的POST参数保存到“最近一次POST参数”中,否则将“最近一次POST参数”的值设置为空;然后,将HTTP响应的响应状态码修改为“302”,将WWW-Authenticate响应头部去掉,将可能包含的HTTP响应主体(Body)及响应主体长度指示去掉,在响应中加入Location头部,其值为身份服务系统的用户登录页面URL,且该URL通过Query String附加了单点登录HTTP插件所在的Web应用系统的系统标识,最后,让修改后的HTTP响应通过,完成本次HTTP响应的处理;B6. The HTTP identity authentication protocol indicated in the WWW-Authenticate header is stored in the "identity authentication protocol" of the user login information, the "user identity information" is set to empty, and the "server end returns protocol data and Parameter" is set to the value of the WWW-Authenticate header of the HTTP response to obtain the HTTP request URL corresponding to the current HTTP response, and save it as the value of the "protected URL to be accessed last time"; if the current HTTP response corresponds to If the method of the HTTP request is POST, save the POST parameter corresponding to the request in the "last POST parameter", otherwise set the value of "last POST parameter" to empty; then, modify the response status code of the HTTP response If it is "302", remove the WWW-Authenticate response header, remove the possible HTTP response body (Body) and the length indication of the response body, and add the Location header to the response, whose value is the user login page URL of the identity service system , and the URL is appended with the system identifier of the web application system where the single sign-on HTTP plug-in is located through the Query String, and finally, the modified HTTP response is passed to complete the processing of this HTTP response;
B7.获取当前HTTP响应对应的HTTP请求URL,根据相关配置信息确定该HTTP请求URL是否对应受安全保护的Web页面,若不是,则让HTTP响应通过,完成本次HTTP响应的处理;否则,转入下一步骤;B7. obtain the HTTP request URL corresponding to the current HTTP response, determine whether the HTTP request URL corresponds to a securely protected Web page according to relevant configuration information, if not, allow the HTTP response to pass through, and complete the processing of this HTTP response; otherwise, turn to into the next step;
B8.若HTTP响应中包含有WWW-Authenticate响应头部,则将WWW-Authenticate响应头部去掉;若当前HTTP响应对应的HTTP请求的URL与“最近一次要访问的受保护的URL”相同,则将“最近一次要访问的受保护的URL”和“最近一次POST参数”的值设置为空;B8. If the WWW-Authenticate response header is included in the HTTP response, then the WWW-Authenticate response header is removed; if the URL of the HTTP request corresponding to the current HTTP response is the same as "the last protected URL to be accessed", then Set the values of "Last protected URL to visit" and "Last POST parameter" to empty;
B9.根据单点登录HTTP插件的配置信息中针对当前所使用的HTTP身份鉴别协议所设定的、在用户身份鉴别成功后的“服务器端返回协议数据与参数”的值的设置方式,设置“服务器端返回协议数据与参数”的值,然后让修改后的HTTP响应通过,完成本次HTTP响应的处理。B9. According to the setting method of the value of "server-side return protocol data and parameters" set for the currently used HTTP identity authentication protocol in the configuration information of the single sign-on HTTP plug-in after the user identity authentication is successful, set " The server returns the value of "Protocol Data and Parameters", and then allows the modified HTTP response to pass to complete the processing of this HTTP response.
所述步骤B3中所述的WWW-Authenticate头部的值是进行身份鉴别的初始提示是指该头部的值是用户完成身份鉴别前,初次访问受保护的页面时,Web服务器端初次返回的要求进行身份鉴别的WWW-Authenticate响应头部的数据。The value of the WWW-Authenticate header described in the step B3 is an initial prompt for identity authentication, which means that the value of the header is the value returned by the Web server for the first time before the user completes the identity authentication when accessing the protected page for the first time. Data in the WWW-Authenticate response header that requires authentication.
所述步骤B3中所述的身份凭证数据,是指能证明用户身份的电子数据,如帐户名、口令(如HTTP Basic),或者是包含身份确认信息的安全令牌(如HTTP Negotiate的Spnego Token);所述经身份凭证数据密码运算后的数据,是指经身份凭证,如用户/口令,通过一定的密码运算(如HASH运算)后得到数据(如HTTP NTLM的经帐户名、口令散列运算的Type3数据)。The identity credential data described in the step B3 refers to electronic data that can prove the identity of the user, such as account name, password (such as HTTP Basic), or a security token (such as the Spnego Token of HTTP Negotiate) that contains identity confirmation information. ); the data after the identity credential data password calculation refers to the identity credential, such as user/password, after certain password calculation (such as HASH calculation) to obtain data (such as HTTP NTLM via account name, password hash Operational Type3 data).
若单点登录HTTP插件拦截的HTTP响应包含多个WWW-Authenticate头部,则所述步骤B3中所用的WWW-Authenticate头部和所述步骤B4、B5、B6中所用的、其值被保存到“服务器端返回协议数据与参数”中的WWW-Authenticate头部以及所述步骤B6中保存“身份鉴别协议”所使用的WWW-Authenticate头部,是一个根据预定的规则选择的对应于某个HTTP身份鉴别协议的WWW-Authenticate头部(比如,按从Negotiate、NTLM、Digest到Basic协议优先顺序选择的WWW-Authenticate头部),而在所述步骤B4、5、6、8中删除的WWW-Authenticate头部包括所有的WWW-Authenticate头部。If the HTTP response intercepted by the single sign-on HTTP plug-in includes multiple WWW-Authenticate headers, the WWW-Authenticate header used in the step B3 and the values used in the steps B4, B5, and B6 are saved to The WWW-Authenticate header in the "server-side return protocol data and parameters" and the WWW-Authenticate header used to save the "identity authentication protocol" in the step B6 are selected according to predetermined rules corresponding to a certain HTTP The WWW-Authenticate header of the identity authentication protocol (for example, the WWW-Authenticate header selected according to the priority order from Negotiate, NTLM, Digest to Basic protocol), and the WWW-Authenticate header deleted in the steps B4, 5, 6, and 8 The Authenticate header includes all WWW-Authenticate headers.
所述步骤B4、B5、B6、B9中所述的修改后的HTTP响应从数据结构上来说既可以是在原HTTP响应数据结构上直接修改后得到的HTTP响应,也可以是在一个新的HTTP响应数据结构上新生成的HTTP响应。The modified HTTP response described in steps B4, B5, B6, and B9 can be an HTTP response obtained after directly modifying the original HTTP response data structure in terms of data structure, or a new HTTP response The data structure on the newly generated HTTP response.
所述步骤B7中所述相关配置信息指Web服务组件和/或单点登录HTTP插件的与安全访问控制、身份鉴别、单点登录有关的配置信息。The relevant configuration information in the step B7 refers to the configuration information related to security access control, identity authentication and single sign-on of the Web service component and/or the single sign-on HTTP plug-in.
在以上所述步骤中,将HTTP响应的状态码修改或设置为“302”并在响应中加入Location头部,即进行所谓HTTP重定向,将浏览器引导到Location所指的页面或Web站点。In the above steps, the status code of the HTTP response is modified or set to "302" and the Location header is added to the response, that is, the so-called HTTP redirection is performed to guide the browser to the page or Web site indicated by the Location.
单点登录HTTP插件在HTTP响应处理阶段根据不同情形分别按如下方式获得当前HTTP响应对应的HTTP请求的请求行、头部和主体中的相关数据(如请求URL、Cookie、Authorization头部、POST参数等):The single sign-on HTTP plug-in obtains the relevant data in the request line, header and body of the HTTP request corresponding to the current HTTP response (such as request URL, Cookie, Authorization header, POST parameter wait):
情形2.1:若HTTP插件能直接访问HTTP请求中的相关数据头部,则直接从请求中获得相关数据;否则,Scenario 2.1: If the HTTP plug-in can directly access the relevant data header in the HTTP request, then obtain the relevant data directly from the request; otherwise,
情形2.2:若Web服务组件提供了基于TCP连接的数据存储位置,则单点登录HTTP插件在HTTP请求处理阶段完成所有相关处理包括将GET方式的请求转换为POST方式的请求后,让HTTP请求通过前,将当前HTTP请求的相关数据保存到基于TCP连接的数据存储位置,由单点登录HTTP插件在HTTP响应处理阶段获取;否则,Scenario 2.2: If the Web service component provides a data storage location based on a TCP connection, the single sign-on HTTP plug-in completes all relevant processing in the HTTP request processing stage, including converting the GET request into a POST request, and then allows the HTTP request to pass through Before, save the relevant data of the current HTTP request to the data storage location based on the TCP connection, which will be obtained by the single sign-on HTTP plug-in during the HTTP response processing stage; otherwise,
情形2.3:若Web服务组件提供了基于HTTP会话的数据存储位置,则单点登录HTTP插件在HTTP请求处理阶段完成所有相关处理包括将GET方式的请求转换为POST方式的请求后,让HTTP请求通过前,将当前HTTP请求的相关数据保存到基于HTTP会话的数据存储位置,由单点登录HTTP插件在HTTP响应处理阶段获取;否则,Scenario 2.3: If the Web service component provides a data storage location based on the HTTP session, the single sign-on HTTP plug-in completes all related processing in the HTTP request processing stage, including converting the GET request to the POST request, and then allows the HTTP request to pass through Before, save the relevant data of the current HTTP request to the data storage location based on the HTTP session, which will be obtained by the single sign-on HTTP plug-in during the HTTP response processing phase; otherwise,
情形2.4:若在HTTP请求处理阶段能直接设置HTTP响应的头部,则单点登录HTTP插件在HTTP请求处理阶段完成所有相关处理包括将GET方式的请求转换为POST方式的请求后,让HTTP请求通过前,将当前HTTP请求的相关数据,通过自定义的HTTP响应头部传递到HTTP响应处理阶段的单点登录HTTP插件获取,单点登录HTTP插件在HTTP响应处理阶段通过自定义头部获取相关数据后,删除该自定义头部;否则,Scenario 2.4: If the header of the HTTP response can be directly set during the HTTP request processing stage, the single sign-on HTTP plug-in completes all related processing in the HTTP request processing stage Before passing, the relevant data of the current HTTP request is passed to the single sign-on HTTP plug-in in the HTTP response processing stage through the custom HTTP response header. data, delete the custom header; otherwise,
情形2.5:若单点登录HTTP插件有定制开发的基于TCP连接或会话的数据存储位置,则单点登录HTTP插件在HTTP请求处理阶段完成所有相关处理包括将GET方式的请求转换为POST方式的请求后,让HTTP请求通过前,将当前HTTP请求的相关数据保存到定制开发的基于TCP连接或会话的数据存储位置,由单点登录HTTP插件在HTTP响应处理阶段获取;否则,Scenario 2.5: If the single sign-on HTTP plug-in has a custom-developed TCP connection or session-based data storage location, the single sign-on HTTP plug-in completes all related processing in the HTTP request processing stage, including converting the GET request to the POST request After that, before allowing the HTTP request to pass through, save the relevant data of the current HTTP request to the custom-developed data storage location based on the TCP connection or session, which will be obtained by the single sign-on HTTP plug-in during the HTTP response processing stage; otherwise,
情形2.6:单点登录HTTP插件在HTTP请求处理阶段完成所有相关处理包括将GET方式的请求转换为POST方式的请求后,让HTTP请求通过前,通过线程(Thread)机制将当前HTTP请求的相关数据传送到HTTP响应处理阶段的单点登录HTTP插件。Scenario 2.6: The single sign-on HTTP plug-in completes all relevant processing in the HTTP request processing stage, including converting the GET request to the POST request, and before allowing the HTTP request to pass through, the relevant data of the current HTTP request is passed through the thread (Thread) mechanism. Single sign-on HTTP plugin passed to the HTTP response processing stage.
在所述情形2.2-2.6,单点登录HTTP插件在HTTP请求处理阶段完成所有相关处理包括将GET方式的请求转换为POST方式的请求后,让HTTP请求通过前,只需要将受安全保护的Web页面的POST参数(若有)传递到HTTP响应处理阶段的单点登录HTTP插件。In the above situations 2.2-2.6, after the single sign-on HTTP plug-in completes all relevant processing in the HTTP request processing stage, including converting the GET request to the POST request, before allowing the HTTP request to pass through, it only needs to The page's POST parameters (if any) are passed to the Single Sign-On HTTP plugin during the HTTP response processing phase.
当用户浏览器被单点登录HTTP插件在HTTP响应处理阶段的所述步骤B6通过将HTTP响应的状态码修改或设置为“302”并设置HTTP响应的Location头部重定向到身份服务系统的用户登录页面后,身份服务系统按如下方式进行HTTP请求处理:When the user's browser is redirected to the user login of the identity service system by modifying or setting the status code of the HTTP response to "302" and setting the Location header of the HTTP response in the step B6 of the HTTP response processing stage by the single sign-on HTTP plug-in After the page, the identity service system handles the HTTP request as follows:
C1.通过HTTP请求URL的Query String中携带的Web应用系统标识确定用户要访问的Web应用系统是否是身份服务系统信任、提供服务的系统,若不是,则返回出错信息;否则,转入下一步骤;C1. Determine whether the Web application system that the user wants to access is a system that the identity service system trusts and provides services through the Web application system identifier carried in the Query String of the HTTP request URL. If not, return an error message; otherwise, go to the next step step;
C2.确定用户之前是否已在身份服务系统完成身份鉴别,若是,则转入下一步骤;否则,将用户引导到登录页面,并基于用户主帐户对用户进行身份鉴别,鉴别成功后转入下一步骤;C2. Determine whether the user has completed identity authentication in the identity service system before, and if so, go to the next step; otherwise, guide the user to the login page, and authenticate the user based on the user's main account. After the authentication is successful, go to the next step one step;
C3.根据用户的主帐户及用户要访问的Web应用系统,在主从帐户绑定数据库中获得用户在要访问的Web应用系统中的从帐户名和口令;C3. Obtain the user's slave account name and password in the web application system to be accessed in the master-slave account binding database according to the user's master account and the web application system to be accessed by the user;
C4.为用户生成一个包含其主帐户名、从帐户名及加密后的从帐户口令的安全令牌,并对相关信息进行数字签名,然后将包含安全令牌的用户身份证明信息以Form表单的方式返回到用户浏览器,并通过Form表单的自动POST提交(Submit)方式将包含安全令牌的用户身份证明信息提交到用户需要访问的Web应用系统的安全令牌处理页面。C4. Generate a security token for the user that includes its primary account name, secondary account name, and encrypted secondary account password, and digitally sign the relevant information, and then submit the user identity certification information containing the security token in the Form The method returns to the user's browser, and submits the user identification information including the security token to the security token processing page of the Web application system that the user needs to visit through the automatic POST submission (Submit) mode of the Form form.
安全令牌处理页面接收到身份服务系统签发并由用户浏览器通过Form表单自动POST方式提交的包含安全令牌的用户身份证明信息后,按如下方式进行处理:After the security token processing page receives the user identity certification information including the security token issued by the identity service system and submitted by the user browser through the automatic POST form of the Form, it will process it as follows:
D1.通过数字签名验证安全令牌是否有效,若有效,转入下一步骤;否则,返回出错提示;D1. Verify whether the security token is valid through a digital signature, if valid, go to the next step; otherwise, return an error message;
D2.从安全令牌中分离出用户的主帐户名和从帐户名、口令,解密从帐户口令,然后,在HTTP响应中创建Set-Cookie头部,设置存放“用户身份信息”的Cookie,Cookie的值包含加密后的主帐户名和从帐户名、口令;D2. Separate the user's primary account name, secondary account name, and password from the security token, decrypt the secondary account password, and then create a Set-Cookie header in the HTTP response to set the Cookie for storing "user identity information". The value contains the encrypted master account name and slave account name, password;
D3.将HTTP响应的状态码设置为“302”,在HTTP响应中创建一个Location头部,该头部的值设置为从Cookie中获得“最近一次要访问的受保护的URL”,然后返回HTTP响应。D3. Set the status code of the HTTP response to "302", create a Location header in the HTTP response, and set the value of the header to obtain "the last protected URL to be accessed" from the cookie, and then return HTTP response.
当用户浏览器被单点登录HTTP插件在HTTP响应处理阶段的所述步骤B4通过将HTTP响应的状态码修改或设置为“302”并设置HTTP响应的Location头部重定向到身份服务系统的用户代登录出错页面URL后,身份服务系统按如下方式进行HTTP请求处理;When the user browser is redirected to the user agent of the identity service system by modifying or setting the status code of the HTTP response to "302" and setting the Location header of the HTTP response in the step B4 of the HTTP response processing stage by the single sign-on HTTP plug-in After logging in to the URL of the error page, the identity service system processes the HTTP request as follows;
E1.通过HTTP请求URL中携带的Web应用系统标识确定用户要访问的Web应用系统是否是身份服务系统信任、提供服务的系统,若不是,则返回出错信息;否则,转入下一步骤;E1. Determine whether the Web application system that the user wants to access is a system that the identity service system trusts and provides services through the Web application system identifier carried in the HTTP request URL, if not, return an error message; otherwise, go to the next step;
E2.提示用户输入、提交其要访问的Web应用系统中的帐户名、口令;E2. Prompt the user to input and submit the account name and password in the web application system to be accessed;
E3.用户提交帐户名、口令后,确定用户之前是否已登录身份服务系统完成身份鉴别,若是,则转入步骤E5;否则,转入下一步骤;E3. After the user submits the account name and password, determine whether the user has logged into the identity service system to complete identity authentication, if so, then proceed to step E5; otherwise, proceed to the next step;
E4.返回身份服务系统的用户登录页面,并基于用户主帐户对用户进行身份鉴别,鉴别成功后转入下一步;E4. Return to the user login page of the identity service system, and identify the user based on the user's main account, and proceed to the next step after the identification is successful;
E5.基于步骤E2、E3获得的用户在Web应用系统中的帐户名、口令,在主从帐户绑定数据库中,更新用户在对应的Web应用系统中从帐户名、口令;E5. Based on the user's account name and password in the Web application system obtained in steps E2 and E3, update the user's account name and password in the corresponding Web application system in the master-slave account binding database;
E6.为用户生成一个包含其主帐户名、从帐户名及加密后的从帐户口令的安全令牌,并对相关信息进行数字签名,然后将包含安全令牌的用户身份证明信息以Form表单的方式返回到用户浏览器,并通过Form表单的自动POST提交(Submit)方式将包含安全令牌的用户身份证明信息提交到用户需要访问的Web应用系统的安全令牌处理页面。E6. Generate a security token for the user that includes its primary account name, secondary account name, and encrypted secondary account password, and digitally sign the relevant information, and then submit the user identity certification information containing the security token in the Form The method returns to the user's browser, and submits the user identification information including the security token to the security token processing page of the Web application system that the user needs to visit through the automatic POST submission (Submit) mode of the Form form.
若所述Web应用系统的整个Web路径(目录)都是安全保护的路径,且无法在受安全保护的路径(目录)之中或之外设置一个非受安全保护的路径(目录),则安全令牌处理页面不是一个实际存在的Web页面,而仅仅是一个虚拟的Web页面路径;相应地,所述单点登录HTTP插件在HTTP请求处理阶段拦截提交到安全令牌处理页面的HTTP请求,完成步骤D1所述的处理操作,然后在该HTTP请求的响应处理阶段,拦截HTTP响应,完成步骤D2、D3所述的处理操作。If the entire Web path (directory) of the Web application system is a path protected by security, and a path (directory) that is not protected by security cannot be set in or outside the path (directory) protected by security, then the security The token processing page is not an actual web page, but a virtual web page path; correspondingly, the single sign-on HTTP plug-in intercepts the HTTP request submitted to the security token processing page in the HTTP request processing stage, and completes The processing operation described in step D1, and then in the response processing stage of the HTTP request, intercept the HTTP response, and complete the processing operations described in steps D2 and D3.
若用户对所述Web应用系统的访问是通过Web代理(Proxy)进行的,且由Web代理通过HTTP身份鉴别协议的代理模式对用户进行身份鉴别,且Web代理在其HTTP请求、响应处理通道中提供了HTTP插件机制,且基于该插件机制的HTTP插件能够拦截HTTP身份鉴别协议的请求、响应数据,则在做如下相应改变的情况下本发明所述的方法同样适用:If the user's access to the Web application system is carried out through a Web proxy (Proxy), and the Web proxy authenticates the user through the proxy mode of the HTTP identity authentication protocol, and the Web proxy is in its HTTP request and response processing channel The HTTP plug-in mechanism is provided, and the HTTP plug-in based on the plug-in mechanism can intercept the request and response data of the HTTP identity authentication protocol, then the method described in the present invention is also applicable when the following corresponding changes are made:
所述Web服务组件指Web代理;所述Web应用组件指Web代理之后的整个Web系统(本身也包含一个或多个Web服务组件和Web应用软件);所述Web代理和其后的整个Web系统构成了所述Web应用系统;所述单点登录HTTP插件部署在所述Web代理上,且在其所部署的Web代理上被配置为拦截所有的HTTP请求、响应;所述的HTTP响应状态码“401”变为“407”(提示Proxy Authentication Required),所述HTTP响应头部WWW-Authenticate变为Proxy-Authenticate头部,所述HTTP请求头部Authorization变为Proxy-Authorization头部。The Web service component refers to a Web proxy; the Web application component refers to the entire Web system behind the Web proxy (itself also includes one or more Web service components and Web application software); the Web proxy and the entire Web system thereafter The Web application system is constituted; the single sign-on HTTP plug-in is deployed on the Web proxy, and is configured to intercept all HTTP requests and responses on the deployed Web proxy; the HTTP response status code "401" becomes "407" (Proxy Authentication Required), the HTTP response header WWW-Authenticate becomes a Proxy-Authenticate header, and the HTTP request header Authorization becomes a Proxy-Authorization header.
本发明的单点登录集成方法,针对的只是整个单点登录系统中采用HTTP身份鉴别协议且该HTTP身份鉴别协议的使用不能替换或更改的Web应用系统;对于其他的Web应用系统,可采用其他的单点登录集成方法。The single sign-on integration method of the present invention is only aimed at the Web application system that uses the HTTP identity authentication protocol in the entire single sign-on system and the use of the HTTP identity authentication protocol cannot be replaced or changed; for other Web application systems, other Web application systems can be used. single sign-on integration method.
本发明的创新之处在于:通过单点登录HTTP插件,使得使用HTTP身份鉴别协议(如Basic,Digest,NTLM,Negotiate)对用户进行身份鉴别的Web应用系统,能够在不改变身份鉴别配置且不修改应用程序的情况下实现单点登录。它解决了单点登录在实际应用集成中常见的一个技术难题。The innovation of the present invention is that: through the single sign-on HTTP plug-in, the Web application system that uses the HTTP identity authentication protocol (such as Basic, Digest, NTLM, Negotiate) to authenticate the user can be configured without changing the identity authentication. Implement single sign-on without modifying the application. It solves a common technical problem of single sign-on in practical application integration.
本发明的一个特点是:用户即便在外网仍然能够访问采用Kerberos协议(即HTTP Negotiate协议且使用Kerberos进行身份鉴别)的Web应用系统。A feature of the present invention is: the user can still access the Web application system that adopts the Kerberos protocol (i.e. HTTP Negotiate protocol and uses Kerberos for identity authentication) even in the external network.
附图说明 Description of drawings
图1为本采用本发明的单点登录系统整体结构框图。FIG. 1 is a block diagram of the overall structure of the single sign-on system of the present invention.
具体实施方式 Detailed ways
下面结合附图对本发明作进一步的详细描述。The present invention will be described in further detail below in conjunction with the accompanying drawings.
本发明是一种面向HTTP身份鉴别协议的插件式单点登录集成方法,采用本方法的单点登录系统的整体结构如图1所示,包括Web服务组件、Web应用组件、单点登录HTTP插件、安全令牌处理页面、浏览器、身份服务系统、主帐户数据库、主从帐户绑定数据库,其中Web服务组件、Web应用组件构成了Web应用系统,而各组成部分的功能在前面的发明内容中已做了详细描述,在此不再重复。在整个单点登录系统的系统组件中,单点登录HTTP插件、安全令牌处理页面、身份服务系统、主帐户数据库、主从帐户绑定数据库属于本发明要实现的内容,而在要实现的内容中,单点登录HTTP插件又是最关键、最主要的部分。The present invention is a plug-in single sign-on integration method for the HTTP identity authentication protocol. The overall structure of the single sign-on system using this method is shown in Figure 1, including Web service components, Web application components, and single sign-on HTTP plug-ins. , a security token processing page, a browser, an identity service system, a master account database, and a master-slave account binding database, wherein the Web service component and the Web application component constitute the Web application system, and the functions of each component are described in the preceding content of the invention has been described in detail and will not be repeated here. Among the system components of the whole single sign-on system, the single sign-on HTTP plug-in, the security token processing page, the identity service system, the master account database, and the master-slave account binding database belong to the content to be realized by the present invention. Among the content, the single sign-on HTTP plug-in is the most critical and main part.
对于身份服务系统的实现,可以采用已有的各种成熟的信息系统开发技术,如J2EE技术,ASP.NET技术等;对于主帐户数据库,可以采用LDAP、关系数据库,或已有的Windows Active Directory或某个应用系统帐户数据库;对于主从帐户绑定数据库,可以使用关系数据库。主从帐户绑定数据库只要保存这样一些信息:1)用户的主帐户名;2)主帐户对应的用户在每个授权访问的应用系统中从帐户名及口令。For the realization of the identity service system, various existing mature information system development technologies can be used, such as J2EE technology, ASP.NET technology, etc.; for the main account database, LDAP, relational database, or existing Windows Active Directory can be used Or an application system account database; for the master-slave account binding database, a relational database can be used. The master-slave account binding database only needs to save such information: 1) the user's master account name; 2) the user's slave account name and password in each authorized access application system corresponding to the master account.
单点登录HTTP插件和安全令牌处理页面的实现,取决于其要部署的Web服务组件(但不必与Web应用组件的开发技术一样)。下面针对一些常用的Web服务组件,相应的具体实施方案描述如下。The implementation of the single sign-on HTTP plug-in and the security token processing page depends on the Web service component to be deployed (but does not have to be the same as the development technology of the Web application component). For some common Web service components, the corresponding specific implementation schemes are described as follows.
如果Web服务组件是Windows IIS5,则单点登录HTTP插件可以基于ISAPI Filter实现,具体方案如下。If the Web service component is Windows IIS5, the single sign-on HTTP plug-in can be implemented based on ISAPI Filter, and the specific scheme is as follows.
单点登录HTTP插件使用ISAPI Filter提供的基于TCP连接的数据存储位置,即ISAPI传递给ISAPI入点函数(Entry-Point Function)HttpFilterProc(...)的HTTP_FILTER_CONTEXT结构类型的输入参数pfc中的pFilterContext字段,保存“服务器端返回协议数据与参数”。单点登录HTTP插件(经入点函数GetFilterVersion(...)注册)在HTTP请求处理阶段对SF_NOTIFY_READ_RAW_DATA、SF_NOTIFY_PREPROC_HEADERS通知事件做出响应,完成相应的处理,其中:解密用户身份信息、增加Authorization请求头部的操作在响应SF_NOTIFY_PREPROC_HEADERS通知事件时进行;将GET方式的HTTP请求转换成POST方式的请求(在需要时),并将“最近一次POST参数”中的数据作为POST参数加入到在HTTP请求主体中的操作在响应SF_NOTIFY_READ_RAW_DATA通知事件时进行;如果当前HTTP请求是POST方式(包括经GET、POST转化后的HTTP请求),单点登录HTTP插件在响应SF_NOTIFY_READ_RAW_DATA通知事件时,将当前请求的POST参数保存在所述pFilterContext字段中,由单点登录HTTP插件在响应处理阶段获取。单点登录HTTP插件在HTTP处理阶段可通过ISAPI Filter提供的回调函数(callback function)获取HTTP请求行、请求头部的各种信息,如请求URL、Cookie等。The single sign-on HTTP plug-in uses the data storage location based on the TCP connection provided by ISAPI Filter, that is, the pFilterContext field in the input parameter pfc of the HTTP_FILTER_CONTEXT structure type passed by ISAPI to the ISAPI Entry-Point Function (Entry-Point Function) HttpFilterProc(...) , and save the "Server Return Protocol Data and Parameters". The single sign-on HTTP plug-in (registered through the entry point function GetFilterVersion(...)) responds to the SF_NOTIFY_READ_RAW_DATA and SF_NOTIFY_PREPROC_HEADERS notification events during the HTTP request processing stage, and completes the corresponding processing, including: decrypting user identity information and adding Authorization request headers The operation is carried out in response to the SF_NOTIFY_PREPROC_HEADERS notification event; convert the HTTP request of GET mode into the request of POST mode (when needed), and add the data in the "last POST parameter" as a POST parameter to the HTTP request body The operation is performed in response to the SF_NOTIFY_READ_RAW_DATA notification event; if the current HTTP request is in the POST mode (including HTTP requests converted from GET and POST), the single sign-on HTTP plug-in will save the POST parameters of the current request in the In the above pFilterContext field, it is obtained by the single sign-on HTTP plug-in during the response processing phase. The single sign-on HTTP plug-in can obtain the HTTP request line and various information in the request header through the callback function (callback function) provided by ISAPI Filter during the HTTP processing stage, such as request URL, Cookie, etc.
单点登录HTTP插件(经通知事件注册)在HTTP响应处理阶段对SF_NOTIFY_SEND_RESPONSE、SF_NOTIFY_SEND_RAW_DATA、SF_NOTIFY_END_OF_NET_SESSION通知事件做出响应,并完成相应的处理,其中:在响应SF_NOTIFY_SEND_RESPONSE、SF_NOTIFY_SEND_RAW_DATA通知事件时,完成修改HTTP响应(包括修改状态行、头部和删除响应主体)、保存用户登录信息等操作处理;在响应SF_NOTIFY_END_OF_NET_SESSION通知事件时,释放相应的系统资源。实际上,单点登录HTTP插件在HTTP响应处理阶段对HTTP响应的修改,既可在SF_NOTIFY_SEND_RESPONSE和SF_NOTIFY_SEND_RAW_DATA两个通知事件点分别配合完成部分操作,也可以在SF_NOTIFY_SEND_RAW_DATA通知事件点完成全部操作,也就是说,可以不对SF_NOTIFY_SEND_RESPONSE通知事件作出响应。在HTTP响应处理阶段的单点登录HTTP插件可通过ISAPI Filter提供的回调函数获取HTTP请求行、请求头部的各种信息,如请求URL、Cookie等,以及修改响应,生成新的响应;单点登录HTTP插件在HTTP响应处理阶段,从所述pFilterContext字段中获取单点登录HTTP插件在HTTP请求处理阶段保存的POST方式的POST参数(也即采用情形2.2的方案)。The single sign-on HTTP plug-in (registered by the notification event) responds to the SF_NOTIFY_SEND_RESPONSE, SF_NOTIFY_SEND_RAW_DATA, SF_NOTIFY_END_OF_NET_SESSION notification events during the HTTP response processing phase, and completes the corresponding processing, wherein: when responding to the SF_NOTIFY_SEND_RESPONSE, SF_NOTIFY_SEND_RAW_DATA notification events, complete the modification of the HTTP response ( Including modifying the status line, header and deleting the response body), saving user login information and other operations; when responding to the SF_NOTIFY_END_OF_NET_SESSION notification event, release the corresponding system resources. In fact, the modification of the HTTP response by the single sign-on HTTP plug-in in the HTTP response processing stage can not only complete part of the operations at the two notification event points of SF_NOTIFY_SEND_RESPONSE and SF_NOTIFY_SEND_RAW_DATA, but also complete all operations at the SF_NOTIFY_SEND_RAW_DATA notification event point, that is to say , you can not respond to the SF_NOTIFY_SEND_RESPONSE notification event. The single sign-on HTTP plug-in in the HTTP response processing stage can obtain the HTTP request line and various information of the request header through the callback function provided by ISAPI Filter, such as request URL, Cookie, etc., and modify the response to generate a new response; single point In the HTTP response processing stage, the login HTTP plug-in obtains the POST parameters saved by the single sign-on HTTP plug-in in the HTTP request processing stage from the pFilterContext field (that is, adopts the solution of scenario 2.2).
而安全令牌处理页面可以基于ISAPI Extension实现。基于ISAPIExtension的安全令牌处理页面可通过调用ISAPI Extension的回调函数处理请求、生成响应。安全令牌处理页面或者位于不受安全保护的目录(路径),或者位于受安全保护的目录(路径)中的一个不受安全保护的子目录(子路径)。单点登录HTTP插件和安全令牌处理页面基于IIS的Administration API获取IIS的相关安全配置信息,如受保护的目录(路径)、使用的身份鉴别协议等。The security token processing page can be implemented based on ISAPI Extension. The security token processing page based on ISAPIExtension can process requests and generate responses by calling the callback function of ISAPI Extension. The security token processing page is located either in the unsecured directory (path), or in an unsecured subdirectory (subpath) within the secured directory (path). The single sign-on HTTP plug-in and the security token processing page obtain the relevant security configuration information of IIS based on the Administration API of IIS, such as the protected directory (path), the authentication protocol used, and so on.
如果Web服务组件是Windows IIS6,则或者将IIS6配置成IIS5工作模式,然后使用前面所述的IIS5的单点登录HTTP插件;或者,按如下方式实现单点登录HTTP插件:If the web service component is Windows IIS6, then either configure IIS6 to work in IIS5 mode, and then use the IIS5 single sign-on HTTP plug-in described above; or, implement the single sign-on HTTP plug-in as follows:
单点登录HTTP插件使用与IIS5中同样的方法,保存“服务器端返回协议数据与参数”。单点登录HTTP插件在HTTP请求处理阶段只对SF_NOTIFY_PREPROC_HEADERS通知事件做出响应,除了不进行将GET方法转化成POST方法,以及将POST方法的POST参数保存在pFilterContext字段中的操作外,其他操作处理的实现与IIS5中的实现相同。单点登录HTTP插件在HTTP相应处理阶段的实现,除了不保存POST方法的POST参数外,其他操作处理的实现与IIS5中的相同。安全令牌处理页面的实现与IIS5中的相同。The single sign-on HTTP plug-in uses the same method as in IIS5 to save "server-side return protocol data and parameters". The single sign-on HTTP plug-in only responds to the SF_NOTIFY_PREPROC_HEADERS notification event during the HTTP request processing stage, except for converting the GET method into a POST method and saving the POST parameters of the POST method in the pFilterContext field, other operations processed The implementation is the same as in IIS5. The implementation of the single sign-on HTTP plug-in in the HTTP corresponding processing stage is the same as that in IIS5 except that the POST parameters of the POST method are not saved. The implementation of the security token handling page is the same as in IIS5.
当IIS6中的单点登录HTTP插件采用非IIS5实现方式时,在实际应用中,会存一点问题:由于不保存POST方法的POST参数,以及在需要时,将GET方法转化成POST方法,因此,当用户初次访问受保护页面时使用的方法是POST,则在用户完成身份鉴别后,将会以GET方法自动再次访问初次要访问的受保护的页面,这样,用户就可能得不到希望获得的结果。但这种情况,并不会造成实质性的损害:一是因为用户初次访问受保护通常采用的方法GET方法,而不是POST方法;二是因为即便初次访问受保护通常采用的方法是GET方法,Web应用系统会提示用户重新提交数据,这以后的POST请求会正常提交、When the single sign-on HTTP plug-in in IIS6 adopts a non-IIS5 implementation, there will be a problem in practical applications: because the POST parameters of the POST method are not saved, and the GET method is converted into a POST method when needed, therefore, When the user accesses the protected page for the first time, the method used is POST. After the user completes the identity authentication, the protected page to be accessed for the first time will be automatically accessed again with the GET method. In this way, the user may not get the desired result. result. But in this case, it will not cause substantial damage: first, because the user’s initial access is usually protected by the GET method, not the POST method; second, even if the initial access is usually protected by the GET method, The web application system will prompt the user to resubmit the data, and subsequent POST requests will be submitted normally.
如果Web服务组件是Windows IIS 7.0及之后的版本,则除了可用前面所述的IIS6的实施方案外,单点登录HTTP插件还可以基于IIS的Native-Code HTTP Module扩展功能或Managed-Code HTTP Module实现,而安全令牌处理页面可以基于ISAPI Extens ion或ASP.NET实现。If the web service component is Windows IIS 7.0 and later versions, in addition to the implementation of IIS6 mentioned above, the single sign-on HTTP plug-in can also be implemented based on the Native-Code HTTP Module extension function or Managed-Code HTTP Module of IIS , and the security token processing page can be implemented based on ISAPI Extension or ASP.NET.
若基于Native-Code HTTP Module实现单点登录HTTP插件,则需要实现一个CHttpModule的派生类,并在该类的OnBeginRequest方法中对HTTP请求进行单点登录处理,在OnSendResponse方法中对HTTP响应进行单点登录处理。单点登录HTTP插件将“服务器端返回协议数据与参数”数据保存在Native-Code HTTP Module的IHttpConnection对象的基于TCP连接的IHttpModuleContextContainer对象中。单点登录HTTP插件,在HTTP响应处理阶段能够直接读取对应HTTP请求的请求行、请求头部和主体中的数据(包括POST参数)。If the single sign-on HTTP plug-in is implemented based on the Native-Code HTTP Module, it is necessary to implement a derived class of CHttpModule, and perform single sign-on processing on HTTP requests in the OnBeginRequest method of this class, and perform single sign-on on HTTP responses in the OnSendResponse method Login processing. The single sign-on HTTP plug-in saves the "server-side return protocol data and parameters" data in the IHttpModuleContextContainer object based on the TCP connection of the IHttpConnection object of the Native-Code HTTP Module. The single sign-on HTTP plug-in can directly read the data (including POST parameters) in the request line, request header and body of the corresponding HTTP request during the HTTP response processing stage.
基于Managed-Code HTTP Module实现单点登录HTTP插件的方法与基于Native-Code HTTP Module实现单点登录HTTP插件的方法类似。关于如何通过Native-Code HTTP Module或Managed-Code HTTP Module开发IIS扩展模块,可参见微软的MSDN(Microsoft Development Network)。The method of implementing the SSO HTTP plug-in based on the Managed-Code HTTP Module is similar to the method of implementing the SSO HTTP plug-in based on the Native-Code HTTP Module. For how to develop IIS extension modules through Native-Code HTTP Module or Managed-Code HTTP Module, please refer to Microsoft's MSDN (Microsoft Development Network).
如果Web应用系统的Web服务组件是JSP/Servlet Web Container(包括J2EE Application Server的Web Container),则单点登录HTTP插件可基于Servlet Filter(这是所有Web容器都有的)、AuthenticationFilter(如WebLogic)、Web容器的Valve(如Tomcat)或其他类似的HTTP插件机制(如WebSphere的TAI等),具体怎样实施以及能否实施,一是取决于Web容器提供了怎样的插件机制,二是看这个插件机制是否能够满足所述的单点登录处理需求,如能够拦截HTTP身份鉴别协议的HTTP请求与响应,能够通过一定的方式对HTTP请求与响应进行修改。比如,若在某个Web Container上部署的HTTP身份鉴别协议的HTTP请求、响应能够被Servlet Filter、Authentication Filter或Valve拦截,则能够基于Servlet Filter、Authentication Filter或Valve实现单点登录HTTP插件。对于JSP/Servlet Web Conta iner提供的HTTP插件机制,单点登录HTTP插件在HTTP响应处理阶段通常是能够直接读取HTTP请求的所有数据。对应JSP/Servlet Web Container,安全令牌处理页面可以基于JSP/Servlet实现。对于安全配置信息的获取,或者采用直接读取配置文件的方法,或者,通过Web容器提供的接口获取。If the Web service component of the Web application system is JSP/Servlet Web Container (including Web Container of J2EE Application Server), the single sign-on HTTP plug-in can be based on Servlet Filter (this is available in all Web containers), AuthenticationFilter (such as WebLogic) , Valve (such as Tomcat) of the Web container or other similar HTTP plug-in mechanisms (such as TAI of WebSphere, etc.), how to implement and whether it can be implemented, one depends on what kind of plug-in mechanism the Web container provides, and the other depends on the plug-in Whether the mechanism can meet the above-mentioned single sign-on processing requirements, such as intercepting the HTTP request and response of the HTTP authentication protocol, and modifying the HTTP request and response in a certain way. For example, if the HTTP request and response of the HTTP authentication protocol deployed on a certain Web Container can be intercepted by Servlet Filter, Authentication Filter or Valve, the single sign-on HTTP plug-in can be implemented based on Servlet Filter, Authentication Filter or Valve. For the HTTP plug-in mechanism provided by JSP/Servlet Web Container, the single sign-on HTTP plug-in is usually able to directly read all the data of the HTTP request during the HTTP response processing phase. Corresponding to JSP/Servlet Web Container, the security token processing page can be implemented based on JSP/Servlet. For obtaining the security configuration information, either directly read the configuration file, or obtain it through the interface provided by the web container.
如果Web应用系统的Web服务组件是Apache HTTP Server、IBM HTTPWeb Server,则可以基于Apache Hook和Filter开发单点登录HTTP插件,其中,HTTP请求处理阶段的功能基于Apache Hook实现,而HTTP响应处理阶段的功能基于Apache Hook和Filter实现,其中,Apache Hook处理头部,Apache Filter处理响应内容。“服务器端返回协议数据与参数”的存储,使用Apache提供的基于TCP连接的数据存储位置。对于Apache Filter而言,单点登录HTTP插件在HTTP响应处理阶段能够直接读取HTTP请求的所有数据。安全令牌处理页面可以基于Apache ContentHandler开发,或者基于相应Web应用组件的页面技术(如Perl、Python)开发。对Apache HTTP Server、IBM HTTP Web Server安全配置信息的获取,或者采用直接读取配置文件的方法,或者,通过Apache提供的接口变量获取,如request_rec结构中的目录配置信息,及request_rec结构中的conn_rec结构中的服务器配置信息。If the Web service component of the Web application system is Apache HTTP Server or IBM HTTP Web Server, then a single sign-on HTTP plug-in can be developed based on Apache Hook and Filter, where the functions in the HTTP request processing phase are implemented based on Apache Hook, and the HTTP response processing phase The function is implemented based on Apache Hook and Filter, among which, Apache Hook processes the header, and Apache Filter processes the response content. The storage of "server-side return protocol data and parameters" uses the data storage location based on the TCP connection provided by Apache. For Apache Filter, the single sign-on HTTP plug-in can directly read all the data of the HTTP request during the HTTP response processing phase. The security token processing page can be developed based on Apache ContentHandler, or based on the page technology (such as Perl, Python) of the corresponding Web application component. To obtain the security configuration information of Apache HTTP Server and IBM HTTP Web Server, either directly read the configuration file, or obtain it through the interface variables provided by Apache, such as the directory configuration information in the request_rec structure and conn_rec in the request_rec structure Server configuration information in the structure.
对于其他的Web服务组件,如Domino Web Server等,都有类似的HTTP插件机制,基于这些Web平台的单点登录HTTP插件和安全令牌处理页面的具体实施方法与前面所述的具体实施方法类似。For other Web service components, such as Domino Web Server, etc., there are similar HTTP plug-in mechanisms. The specific implementation methods of the single sign-on HTTP plug-ins and security token processing pages based on these Web platforms are similar to the specific implementation methods described above. .
另外,对于所涉及的单点登录协议及安全令牌的具体实施,单点登录协议和安全令牌可以采用标准协议,如SAML、WS-FPRP及其,以及相应的SAML断言、WS-Security Token作为证明用户身份的安全令牌;或者,使用自定义的单点登录协议和自定义的安全令牌,只要与本发明所述的交互和处理过程一致即可。若单点登录协议和安全令牌是基于XML(eXtensible Markup Language)的,如SAML、WS-FPRP,则对XML数据的处理可以使用各种成熟的动态库、类库(如Windows CommunicationFoundation类库)、API(如Java API for XML Processing,JAXP)等。对于涉及数据加密、数字签名的实现,可以使用各种成熟的动态库(如OpenSSL)、类库(如Java Cryptography Extension)、API(如WindowsCryptoAPI等)。In addition, for the specific implementation of the involved single sign-on protocol and security token, the single sign-on protocol and security token can use standard protocols, such as SAML, WS-FPRP and the corresponding SAML assertion, WS-Security Token As a security token to prove the identity of the user; or, use a self-defined single sign-on protocol and a self-defined security token, as long as it is consistent with the interaction and processing process described in the present invention. If the single sign-on protocol and security token are based on XML (eXtensible Markup Language), such as SAML, WS-FPRP, then various mature dynamic libraries and class libraries (such as Windows Communication Foundation class library) can be used to process XML data , API (such as Java API for XML Processing, JAXP), etc. For implementations involving data encryption and digital signatures, various mature dynamic libraries (such as OpenSSL), class libraries (such as Java Cryptography Extension), and APIs (such as WindowsCryptoAPI, etc.) can be used.
本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。The content not described in detail in this specification belongs to the prior art known to those skilled in the art.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210067271.XA CN102638454B (en) | 2012-03-14 | 2012-03-14 | A plug-in single sign-on integration method for HTTP authentication protocol |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210067271.XA CN102638454B (en) | 2012-03-14 | 2012-03-14 | A plug-in single sign-on integration method for HTTP authentication protocol |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102638454A CN102638454A (en) | 2012-08-15 |
CN102638454B true CN102638454B (en) | 2014-05-21 |
Family
ID=46622698
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210067271.XA Expired - Fee Related CN102638454B (en) | 2012-03-14 | 2012-03-14 | A plug-in single sign-on integration method for HTTP authentication protocol |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102638454B (en) |
Families Citing this family (39)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102801808B (en) * | 2012-07-30 | 2014-11-05 | 武汉理工大学 | WebLogic-oriented Form identification single sign on integration method |
CN103152351A (en) * | 2013-03-15 | 2013-06-12 | 深信服网络科技(深圳)有限公司 | Network equipment and AD (Active Directory) domain single sign on method and system |
CN103312505B (en) * | 2013-04-08 | 2016-03-02 | 河海大学 | The construction method that a kind of easy-to-use single-sign-on realizes |
US9628468B2 (en) | 2013-09-20 | 2017-04-18 | Oracle International Corporation | Web-based single sign-on with form-fill proxy application |
WO2015147779A1 (en) | 2014-03-24 | 2015-10-01 | Hewlett-Packard Development Company, L.P. | Monitoring for authentication information |
CN104077179B (en) * | 2014-06-16 | 2017-06-06 | 武汉理工大学 | A kind of local API Calls method of web oriented browser |
CN104158797B (en) * | 2014-07-14 | 2017-03-08 | 武汉理工大学 | The password User logs in mutually integrated with identification type password differentiates implementation |
CN104519050B (en) * | 2014-11-14 | 2019-03-12 | 百度在线网络技术(北京)有限公司 | Login method and login system |
CN104468785A (en) * | 2014-12-08 | 2015-03-25 | 上海斐讯数据通信技术有限公司 | Electronic device, server device, and data request submitting method and processing method |
CN104394172B (en) * | 2014-12-12 | 2018-05-25 | 用友网络科技股份有限公司 | Single-sign-on apparatus and method |
CN104468592B (en) * | 2014-12-12 | 2017-10-31 | 北京百度网讯科技有限公司 | Login method and login system |
CN104580406B (en) * | 2014-12-23 | 2019-11-26 | 北京百度网讯科技有限公司 | A kind of method and apparatus of synchronous logging state |
CN104660583B (en) * | 2014-12-29 | 2018-05-29 | 国家电网公司 | A kind of cryptographic services method based on Web cryptographic services |
CN104735066B (en) * | 2015-03-18 | 2018-10-16 | 百度在线网络技术(北京)有限公司 | A kind of single-point logging method of object web page application, device and system |
CN106161521B (en) * | 2015-04-01 | 2019-09-10 | 阿里巴巴集团控股有限公司 | The processing method and processing device of hypertext transfer protocol requests |
CN105407102B (en) * | 2015-12-10 | 2019-05-17 | 四川长虹电器股份有限公司 | Http request data reliability verifying method |
CN105653901A (en) * | 2015-12-29 | 2016-06-08 | 深圳市科漫达智能管理科技有限公司 | Component repository management method and system |
CN105978994B (en) * | 2016-06-22 | 2019-01-18 | 武汉理工大学 | A kind of login method of web oriented system |
CN105959311A (en) * | 2016-07-04 | 2016-09-21 | 天闻数媒科技(湖南)有限公司 | Single sign-on method and device for application system |
EP3433784B1 (en) | 2016-07-12 | 2022-02-23 | Hewlett-Packard Development Company, L.P. | Credential for a service |
CN107204970B (en) * | 2016-11-02 | 2021-02-23 | 北京神州泰岳信息安全技术有限公司 | Single sign-on method and related device |
CN107248971A (en) * | 2016-12-21 | 2017-10-13 | 常熟市盛铭信息技术有限公司 | A kind of design and application method of unified subscriber authentication |
CN106685998B (en) * | 2017-02-24 | 2020-02-07 | 浙江仟和网络科技有限公司 | SSO authentication method based on CAS unified authentication service middleware |
CN109600403B (en) * | 2017-09-30 | 2021-11-02 | 北京国双科技有限公司 | Method and device for sending information |
CN107911376A (en) * | 2017-11-29 | 2018-04-13 | 南京莱斯信息技术股份有限公司 | The WEB systems single-sign-on and access control implementation method of a kind of non-invasive |
CN108667791B (en) * | 2017-12-18 | 2021-01-01 | 中国石油天然气股份有限公司 | Identity authentication method |
CN108650209B (en) * | 2018-03-06 | 2021-05-14 | 北京信安世纪科技股份有限公司 | Single sign-on method, system, device and authentication method |
CN109726544A (en) * | 2018-09-07 | 2019-05-07 | 网联清算有限公司 | Service management and device |
CN109067914B (en) * | 2018-09-20 | 2019-12-13 | 星环信息科技(上海)有限公司 | web service proxy method, device, equipment and storage medium |
US20200106766A1 (en) * | 2018-09-28 | 2020-04-02 | Konica Minolta Laboratory U.S.A., Inc. | Method and system for security assertion markup language (saml) service provider-initiated single sign-on |
CN110032842B (en) * | 2019-03-03 | 2020-11-13 | 北京立思辰安科技术有限公司 | Method and system for simultaneously supporting single sign-on and third party sign-on |
AU2019446557A1 (en) | 2019-05-23 | 2021-11-25 | Citrix Systems, Inc. | Secure web application delivery platform |
CN110661787A (en) * | 2019-09-04 | 2020-01-07 | 苏宁云计算有限公司 | Method and device for capturing Http redirection state code and computer equipment |
CN113127821B (en) * | 2019-12-31 | 2024-08-02 | 远景智能国际私人投资有限公司 | Identity verification method, device, electronic equipment and storage medium |
CN111371775A (en) * | 2020-02-28 | 2020-07-03 | 深信服科技股份有限公司 | Single sign-on method, device, equipment, system and storage medium |
CN112416345B (en) * | 2020-11-16 | 2022-10-21 | 中国电子科技集团公司第二十八研究所 | Universal client software integration system |
CN112822237B (en) * | 2020-12-28 | 2022-07-15 | 北京奇艺世纪科技有限公司 | Network request transmission method and device |
CN113839966B (en) * | 2021-11-26 | 2022-02-22 | 北京慧点科技有限公司 | Security management system based on micro-service |
CN114978745B (en) * | 2022-06-09 | 2025-06-27 | 奇安信科技集团股份有限公司 | Password audit method, device, electronic device and computer-readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1812403A (en) * | 2005-01-28 | 2006-08-02 | 广东省电信有限公司科学技术研究院 | Single-point logging method for realizing identification across management field |
CN101075875A (en) * | 2007-06-14 | 2007-11-21 | 中国电信股份有限公司 | Method and system for realizing monopoint login between gate and system |
CN101588348A (en) * | 2008-05-22 | 2009-11-25 | 中国电信股份有限公司 | System logging method and system logging device based on Web |
CN101651666A (en) * | 2008-08-14 | 2010-02-17 | 中兴通讯股份有限公司 | Method and device for identity authentication and single sign-on based on virtual private network |
CN102215232A (en) * | 2011-06-07 | 2011-10-12 | 浪潮齐鲁软件产业有限公司 | Single sign-on method |
-
2012
- 2012-03-14 CN CN201210067271.XA patent/CN102638454B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1812403A (en) * | 2005-01-28 | 2006-08-02 | 广东省电信有限公司科学技术研究院 | Single-point logging method for realizing identification across management field |
CN101075875A (en) * | 2007-06-14 | 2007-11-21 | 中国电信股份有限公司 | Method and system for realizing monopoint login between gate and system |
CN101588348A (en) * | 2008-05-22 | 2009-11-25 | 中国电信股份有限公司 | System logging method and system logging device based on Web |
CN101651666A (en) * | 2008-08-14 | 2010-02-17 | 中兴通讯股份有限公司 | Method and device for identity authentication and single sign-on based on virtual private network |
CN102215232A (en) * | 2011-06-07 | 2011-10-12 | 浪潮齐鲁软件产业有限公司 | Single sign-on method |
Non-Patent Citations (8)
Title |
---|
企业信息门户单点登录系统的实现;谭立球等;《计算机工程》;20050905;第31卷(第17期);全文 * |
单点登录系统模型分析;淡艳等;《成都大学学报(自然科学版)》;20080630;第27卷(第2期);全文 * |
吴群.安全单点登录问题的研究与实现.《计算机与现代化》.2004,(第106期), |
基于Web服务的单点登录系统的研究与实现;胡毅时等;《北京航空航天大学学报》;20040330;第30卷(第3期);全文 * |
安全单点登录问题的研究与实现;吴群;《计算机与现代化》;20040630(第106期);全文 * |
淡艳等.单点登录系统模型分析.《成都大学学报(自然科学版)》.2008,第27卷(第2期), |
胡毅时等.基于Web服务的单点登录系统的研究与实现.《北京航空航天大学学报》.2004,第30卷(第3期), |
谭立球等.企业信息门户单点登录系统的实现.《计算机工程》.2005,第31卷(第17期), |
Also Published As
Publication number | Publication date |
---|---|
CN102638454A (en) | 2012-08-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102638454B (en) | A plug-in single sign-on integration method for HTTP authentication protocol | |
CN109936569B (en) | Decentralized digital identity login management system based on Ether house block chain | |
US10810515B2 (en) | Digital rights management (DRM)-enabled policy management for an identity provider in a federated environment | |
US10116644B1 (en) | Network access session detection to provide single-sign on (SSO) functionality for a network access control device | |
TWI400922B (en) | Authentication of a principal in a federation | |
US8528058B2 (en) | Native use of web service protocols and claims in server authentication | |
US7860883B2 (en) | Method and system for distributed retrieval of data objects within multi-protocol profiles in federated environments | |
US8151317B2 (en) | Method and system for policy-based initiation of federation management | |
US8196177B2 (en) | Digital rights management (DRM)-enabled policy management for a service provider in a federated environment | |
Samar | Single sign-on using cookies for Web applications | |
CN101507233B (en) | Method and apparatus for providing trusted single sign-on access to applications and internet-based services | |
CN101331735B (en) | Method and system for extending authentication methods | |
US8607322B2 (en) | Method and system for federated provisioning | |
KR100800339B1 (en) | Method and system for authentication and single sign-on determined by user in federated environment | |
US7240362B2 (en) | Providing identity-related information and preventing man-in-the-middle attacks | |
US20150188779A1 (en) | Split-application infrastructure | |
CN113411324B (en) | Method and system for realizing login authentication based on CAS and third-party server | |
CN102624737A (en) | Single sign-on integration method for Form identity authentication in single sign-on system | |
JP2005516533A (en) | Single sign-on on the Internet using public key cryptography | |
JP2012181662A (en) | Account information cooperation system | |
CN115885499A (en) | Authenticating a communication partner at a device | |
Jeong et al. | An XML-based single sign-on scheme supporting mobile and home network service environments | |
KR100992016B1 (en) | Method and apparatus for providing federated functionality within a data processing system | |
Berbecaru et al. | Efficient Attribute Management in a Federated Identity Management Infrastructure | |
CN114282190A (en) | Dual authentication method and electronic equipment thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140521 Termination date: 20180314 |