Single sign-on method, device and system, electronic equipment and storage medium
The CAS proxy server interacts with the CAS server to generate user tokens, which solves the problems of single sign-on difficulty and sensitive data leakage in front-end and back-end separation projects, and improves data security and business scalability.
Patent Information
- Application Number
- CN202410862877.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-06
AI Technical Summary
In front-end and back-end separation projects, the single sign-on (SSO) framework is difficult to implement. The back-end needs to be integrated with the CAS client, and the front-end simulates authorization codes and other modes. There is a risk of sensitive data leakage and affects data security.
Receive the client's login request through the CAS proxy server, interact with the CAS server, generate global login tickets and service tickets, and generate user tokens through the gateway server and write them into the client text file to achieve single sign-on and avoid client imitation authorization. Code and password operations to reduce the risk of sensitive data leakage.
It achieves single sign-on without integrating the CAS client in front-end and back-end separation projects, improves the security of sensitive data, and simplifies the scalability of the business system.
Smart Images

Figure CN118611969A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a single sign-on method, device, system, electronic equipment and storage medium. Background Art
[0002] Single Sign On (SSO) means that once a user logs in once on the identity authentication server, they can access all mutually trusted application systems. This method reduces the time consumption caused by login and assists user management.
[0003] Figure 1 It is a schematic diagram of a single sign-on framework in the prior art, such as Figure 1 As shown, the common framework in the front-end and back-end separation projects is that the front-end uses JSON Web Token (JWT) to interact with the back-end for identity authentication. It is very difficult to perform SSO login under this front-end and back-end separation project architecture system. The back-end needs to integrate the CAS (Central Authentication Service) client, and the front-end simulates the authorization code (auth-code), authentication client (auth-client) and password (password) modes. Each access to a project requires the same repetitive work to be completed. Each business back-end is strongly coupled with the CAS client. Moreover, simulating CAS authorization operations such as authorization codes on the front-end will expose user identity information, which may cause sensitive data to be stolen and is not conducive to the protection of sensitive data. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a single sign-on method, device, system, electronic device and storage medium to improve the security of sensitive data. The specific technical solution is as follows:
[0005] In a first aspect of the implementation of the present invention, a single sign-on method is first provided, which is applied to a CAS proxy server and includes:
[0006] receiving a first login request for a first business system sent by a client, wherein the first login request is sent by the client after being redirected when access to the first business system fails, and the login request includes user identity information;
[0007] Sending the first login request to the CAS server, and receiving a first global login ticket and a first service ticket returned by the CAS server, wherein the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information, the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0008] Sending the first global login ticket to the client, and sending a first verification request including the first service ticket to the CAS server; the first verification request is used to request the CAS server to verify the validity of the first service ticket;
[0009] Receive the domain account returned by the CAS server after the first service ticket is verified, generate a first login permission request including the domain account, and send the first login permission request to the first gateway server corresponding to the first business system, the first login permission request is used to request the first gateway server to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client, and the client accesses the first business system based on the first user token.
[0010] In a second aspect of the present invention, a single sign-on method is provided, which is applied to a client and includes:
[0011] When access to the first business system fails, sending a first login request for the first business system to the CAS proxy server, where the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request;
[0012] Receive a first global login ticket returned by the CAS proxy server, where the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system;
[0013] receiving a first user token sent by a first gateway server corresponding to the first business system, and writing the first user token into a first text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information;
[0014] The first user token is obtained from the first text file, and a first access request including the first user token is generated, the first access request is sent to the first business system, and the requested resource is received from the first business system.
[0015] In a third aspect of the present invention, a single sign-on method is provided, comprising:
[0016] When the client fails to access the first business system, the client redirects the CAS proxy server to send a first login request for the first business system, where the first login request includes user identity information;
[0017] The CAS proxy server sends the first login request to the CAS server;
[0018] The CAS server generates a first global login ticket and a first service ticket according to the user identity information, and sends the first global login ticket and the first service ticket to the CAS proxy server, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0019] The CAS proxy server sends the first global login ticket to the client, and sends a first verification request including the first service ticket to the CAS server;
[0020] The CAS server verifies the validity of the first service ticket, and after the first service ticket is verified, sends the domain account corresponding to the user identity information to the CAS proxy server;
[0021] The CAS proxy server generates a first login permission request including the domain account, and sends the first login permission request to the first gateway server;
[0022] The first gateway server generates a first user token according to the domain account, writes the first user token into a cache of the first business system, and writes the first user token into a first text file of the client;
[0023] The client accesses the first business system based on the first user token.
[0024] In a fourth aspect of the present invention, a single sign-on system is provided, comprising: a client, a first business system, a CAS proxy server, a CAS server, and a first gateway server;
[0025] Wherein, the client is used to redirect and send a first login request for the first business system to the CAS proxy server when access to the first business system fails, and the first login request includes user identity information;
[0026] The CAS proxy server is used to send the first login request to the CAS server;
[0027] The CAS server is used to generate a first global login ticket and a first service ticket according to the user identity information, and send the first global login ticket and the first service ticket to the CAS proxy server, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0028] The CAS proxy server is further configured to send the first global login ticket to the client, and send the first service ticket to the CAS server;
[0029] The CAS server is also used to verify the validity of the first service ticket, and after the first service ticket is verified, send the domain account corresponding to the user identity information to the CAS proxy server;
[0030] The CAS proxy server is further configured to generate a first login permission request including the domain account, and send the first login permission request to the first gateway server;
[0031] The first gateway server is used to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into a first small text file of the client;
[0032] The client is also used to access the first business system based on the first user token.
[0033] In a fifth aspect of the implementation of the present invention, a single sign-on device is also provided, which is applied to a CAS proxy server, comprising:
[0034] A first request receiving module, configured to receive a first login request for a first business system sent by a client, wherein the first login request is sent by the client after being redirected when access to the first business system fails, and the login request includes user identity information;
[0035] a token receiving module, configured to send the first login request to the CAS server, and receive a first global login ticket and a first service ticket returned by the CAS server, wherein the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information, the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0036] a token sending module, configured to send the first global login ticket to the client, and to send a first verification request including the first service ticket to the CAS server; the first verification request is used to request the CAS server to verify the validity of the first service ticket;
[0037] A domain account forwarding module is used to receive the domain account returned by the CAS server after the first service ticket is verified, generate a first login permission request including the domain account, and send the first login permission request to the first gateway server corresponding to the first business system. The first login permission request is used to request the first gateway server to generate a first user token based on the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client. The client accesses the first business system based on the first user token.
[0038] In a sixth aspect of the implementation of the present invention, a single sign-on device is also provided, which is applied to a client and includes:
[0039] A first request sending module, configured to send a first login request for the first business system to the CAS proxy server when access to the first business system fails, wherein the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request;
[0040] A global ticket receiving module, configured to receive a first global login ticket returned by the CAS proxy server, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system;
[0041] A user token storage module is used to receive a first user token sent by a first gateway server corresponding to the first business system, and write the first user token into a first text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information;
[0042] The access request sending module is used to obtain the first user token from the first text file, generate a first access request including the first user token, send the first access request to the first business system, and receive the requested resources returned by the first business system.
[0043] In another aspect of the present invention, there is provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0044] Memory, used to store computer programs;
[0045] The processor is used to implement the method steps described in the first aspect or the method steps described in the second aspect when executing the program stored in the memory.
[0046] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes any of the above-mentioned single sign-on methods.
[0047] In yet another aspect of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned single sign-on methods.
[0048] The single sign-on method, device, system, electronic device and storage medium provided in the embodiments of the present invention interact with the CAS server based on the request of the client through the CAS proxy server to perform a single sign-on authentication operation. There is no need to integrate the CAS client in the business system, and there is no need for the client to simulate modes such as authorization code, authentication client and password, which is conducive to protecting sensitive data such as user identity information and improving the security of sensitive data. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0050] Figure 1 It is a schematic diagram of a single sign-on framework in the prior art;
[0051] Figure 2 is a flow chart of a single sign-on method provided by an embodiment of the present invention;
[0052] Figure 3 is a flow chart of a single sign-on method provided by an embodiment of the present invention;
[0053] Figure 4 is a flow chart of a single sign-on method provided in an embodiment of the present application;
[0054] Figure 5 It is a structural diagram of a single sign-on system provided by an embodiment of the present invention;
[0055] Figure 6 is an example diagram of a single sign-on system under a financial architecture in an embodiment of the present invention;
[0056] Figure 7 It is a structural schematic diagram of a single sign-on device provided by an embodiment of the present invention;
[0057] Figure 8 It is a structural schematic diagram of a single sign-on device provided by an embodiment of the present invention;
[0058] Fig. 9 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0060] Figure 2 1 is a flow chart of a single sign-on method provided by an embodiment of the present invention, and the single sign-on method is applied to a CAS proxy server (CAS-Proxy), such as Figure 2 As shown, the single sign-on method includes the following steps:
[0061] Step 210: receiving a first login request for a first business system sent by a client, wherein the first login request is redirected and sent by the client when access to the first business system fails, and the login request includes user identity information.
[0062] When the client accesses the first business system, if the access fails, it is redirected to the CAS proxy server and the CAS server based on the pre-configured redirection address (https: / / CAS server address?service=proxy address). The user enters the user identity information such as the user name and password for logging into the first business system. The client generates a first login request including the user identity information and sends the first login request to the CAS proxy server.
[0063] Step 220: Send the first login request to the CAS server, and receive a first global login ticket and a first service ticket returned by the CAS server, where the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information.
[0064] The first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket. The first service ticket is used as a credential for the client to log in to the first business system.
[0065] The CAS proxy server sends the first login request to the CAS server. The CAS server generates a TGT (Ticket Granted Ticket, also known as a big token) based on the user identity information in the first login request, as well as a first global login ticket (Ticket Granted Cookie, TGC) and a first service ticket (Service Ticket, ST) for logging into the first business system, and returns the first global login ticket and the first service ticket to the CAS proxy server. Among them, the CAS server is a single sign-on server. Among them, the global login ticket is a global login ticket, which is valid before the logout operation is performed. The client can log in to other business systems associated with the first business system based on the global login ticket. The service ticket is a temporary login ticket, which becomes invalid after the first business system logs in successfully. When other business systems log in based on the global login ticket, they will log in based on another service ticket obtained.
[0066] Step 230: Send the first global login ticket to the client, and send a first authentication request including the first service ticket to the CAS server.
[0067] The first verification request is used to request the CAS server to verify the validity of the first service ticket.
[0068] The CAS proxy server sends the first global login ticket to the client, and returns the first service ticket to the CAS server. The CAS server verifies the validity of the first service ticket. After the first service ticket is verified, the domain account corresponding to the first service ticket is obtained and returned to the CAS proxy server.
[0069] Step 240, receiving the domain account returned by the CAS server after the first service ticket is verified, generating a first login permission request including the domain account, and sending the first login permission request to the first gateway server corresponding to the first business system, the first login permission request is used to request the first gateway server to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client, and the client accesses the first business system based on the first user token.
[0070] The CAS proxy server receives the domain account sent by the CAS server, generates a first login permission request including the domain account, and sends the first login permission request to the first gateway server corresponding to the first business system; the first gateway server calls the first business system according to the domain account in the first login permission request to generate a first user token (Token), writes the first user token into the cache of the first business system, and sends the first user token to the client, notifying the client to write the first user token into the first text file (Cookie), that is, the client writes the first user token into the root domain name of the first business system in the form of a small text file (Cookies). The client can subsequently access the first business system based on the first user token in the first text file.
[0071] The single sign-on method provided in this embodiment is that the CAS proxy server receives a first login request sent by the client and interacts with the CAS server to verify the user identity information of the client. After the verification is passed, the CAS proxy server generates a first login permission request based on the domain account returned by the CAS server, and sends the first login permission request to the first gateway server. The first gateway server generates a first user token based on the domain account in the first login permission request, writes the first user token into the cache of the first business system, and writes the first user token into the first text file of the client, thereby realizing the single sign-on of the client to the first business system. The CAS proxy server interacts with the CAS server based on the request of the client to perform a single sign-on authentication operation. The client does not need to simulate modes such as authorization code, authentication client and password, which is conducive to protecting sensitive data such as user identity information and improving the security of sensitive data. In addition, there is no need to integrate the CAS client in the business system, thereby realizing the complete decoupling of the business system and the CAS service, making it easy to expand other business systems, and improving the scalability of the business in the single sign-on.
[0072] On the basis of the above technical solution, after sending the first login permission request to the first gateway server corresponding to the first business system, the method also includes: receiving a logout request for the first business system sent by the client, the logout request including the user identity information; sending the logout request to the CAS server, the logout request being used to request the CAS server to perform a logout operation of the user identity information for the first business system; based on a callback request of the CAS server, sending a logout permission request to the first gateway server, the logout permission request being used to request the first gateway server to clear the first user token in the cache of the first business system, and clear the first user token under the first text file.
[0073] When the user logs out of the first business system in the client, the client sends a logout request to the CAS proxy server. After receiving the logout request sent by the client, the CAS proxy server sends the logout request to the CAS server. The CAS server executes the logout operation of the user identity information for the first business system. The CAS server calls back the CAS proxy server after the logout operation is completed. Based on the callback request of the CAS server, the CAS proxy server sends a logout permission request to the first gateway server to notify the first gateway server to perform the logout operation. The first gateway server clears the first user token in the cache of the first business system and clears the first user token under the first text file in the client.
[0074] The CAS proxy server executes the client's logout operation on the first business system based on the client's logout request, thereby realizing the front-end logout in the front-end and back-end separation project, and solving the problem that the native front-end and back-end separation project in the prior art does not have the login and logout capabilities.
[0075] On the basis of the above technical solution, after sending the first login permission request to the first gateway server corresponding to the first business system, the method further includes: receiving a second login request for a second business system sent by the client, the second login request is sent by the client through redirection when logging into the first business system, and the second login request includes the first global login ticket; sending the second login request to the CAS server, and receiving a second service ticket returned by the CAS server based on the first global login ticket, the second service ticket is used as a credential for the client to log into the second business system; sending a second verification request including the second service ticket to the CAS server, the second verification request is used to request the CAS server to verify the validity of the second service ticket; receiving the domain account returned by the CAS server after the second service ticket is verified, generating a second login permission request including the domain account, sending the second login permission request to the second gateway server corresponding to the second business system, the second login permission request is used to request the second gateway server to generate a second user token based on the domain account, write the second user token into the cache of the second business system, and write the second user token into the second text file of the client, and the client accesses the second business system based on the second user token.
[0076] The second business system is a system associated with the first business system, and the root domain name corresponding to the second business system and the root domain name corresponding to the first business system are the same root domain name.
[0077] If the client has successfully logged into the first business system and is accessing the second business system based on the first business system, based on the redirection address pre-configured in the client for accessing the second business system based on the first business system, the client sends a second login request for the second business system to the CAS proxy server under the first business system (such as the page of the first business system or the link of the second business system collected in the first business system), and includes the first global login ticket when logging into the first business system in the second login request. The redirection address can be expressed as "http: / / proxy address?url=service jump address", the proxy address is the address of the CAS proxy server, and the service jump address is the real request resource address, that is, the address of the second business system.
[0078] After the CAS proxy server receives the second login request sent by the client, it sends the second login request to the CAS server. The CAS server obtains the first global login ticket under the root domain name from the second login request, and finds the TGT corresponding to the first global login ticket based on the first global login ticket. It generates a second service ticket based on the TGT and sends the second service ticket to the CAS proxy server. The CAS proxy server sends a second verification request including the second service ticket to the CAS server. The CAS server verifies the validity of the second service ticket. After the second service ticket is verified, the CAS server informs the CAS proxy server that the user identity information has been logged in and returns the domain account.
[0079] The CAS proxy server receives the domain account returned by the CAS server, generates a second login permission request including the domain account, and sends the second login permission request to the second gateway server corresponding to the second business system; the second gateway server calls the second business system according to the domain account in the second login permission request to generate a second user token (Token), writes the second user token into the cache of the second business system, and sends the second user token to the client, notifying the client to write the second user token into the second text file, that is, the client writes the second user token into the root domain name of the second business system in the form of a small text file (Cookies). The client can subsequently access the second business system based on the second user token in the second text file.
[0080] When the client logs in to the first business system, when logging in to the second business system, the second business system can be logged in directly based on the user identity information in the first business system, thereby avoiding the user from inputting the user identity information again.
[0081] On the basis of the above technical solution, before receiving the first login request for the first business system sent by the client, the method also includes: receiving a third login request for the first business system sent by the client, the third login request is sent by the client through redirection under the third business system, and the third login request includes a second global login ticket for logging into the third business system, and the second global login ticket is saved in the client when the client logs into the third business system; sending the third login request to the CAS server, and receiving a third service ticket returned by the CAS server based on the second global login ticket; sending a third verification request including the third service ticket to the CAS server, the third verification request is used to request the CAS server to verify the validity of the third service ticket; receiving the logout information returned by the CAS server when the third service ticket fails to be verified, generating a file clearing request, and sending the file clearing request to the client, the file clearing request is used to request the client to clear the third text file corresponding to the third business system and redirect to the CAS proxy server.
[0082] The third business system is a system associated with the first business system, and the root domain name corresponding to the third business system and the root domain name corresponding to the first business system are the same root domain name.
[0083] When the client accesses the first business system through the third business system, based on the redirection address for accessing the first business system based on the third business system pre-configured in the client, the client sends a third login request for the first business system to the CAS proxy server under the third business system (such as the page of the third business system or the link of the second business system collected in the third business system), and includes the second global login ticket when logging into the third business system in the third login request. Among them, the redirection address can be expressed as "http: / / proxy address?url=service jump address", the proxy address is the address of the CAS proxy server, and the service jump address is the real request resource address, that is, the address of the first business system.
[0084] After the CAS proxy server receives the third login request sent by the client, it sends the third login request to the CAS server. The CAS server obtains the second global login ticket under the root domain name from the third login request, and finds the TGT corresponding to the second global login ticket based on the second global login ticket. It generates a third service ticket based on the TGT and sends the third service ticket to the CAS proxy server. The CAS proxy server sends the third verification request including the third service ticket to the CAS server. The CAS server verifies the validity of the third service ticket. After verification, it determines that the client has logged out of the third business system, that is, the third service ticket has not been verified and is invalid. At this time, the CAS server returns the logout information to the CAS proxy server.
[0085] After receiving the logout information returned by the CAS server, the CAS proxy server generates a file clearing request and sends the file clearing request to the client. Based on the file clearing request sent by the CAS proxy server, the client clears the third text file corresponding to the third business system and redirects to the CAS proxy server to request to log in to the first business system.
[0086] When the client logs out of the third business system, when accessing the first business system based on the third business system, the CAS proxy server determines that the client has logged out when interacting with the CAS server to perform identity authentication. At this time, the third text file is cleared, so that other related systems can be logged out at the same time when one system is logged out.
[0087] Figure 3 is a flow chart of a single sign-on method provided by an embodiment of the present invention, and the single sign-on method is applied to a CAS client, such as Figure 3 As shown, the single sign-on method includes the following steps:
[0088] Step 310: When access to the first business system fails, a first login request for the first business system is sent to the CAS proxy server, where the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request.
[0089] When a client accesses the first business system, if the first business system verifies that the client is not logged in, the client is returned with information indicating that the client is not logged in, and the client access fails; or, if the client accesses the first business system through another business system from which the client has logged out, the client access fails.
[0090] When the client fails to access the first business system, it is redirected to the CAS proxy server and the CAS server based on the pre-configured redirection address. The user enters the user name, password and other user identity information for logging into the first business system. The client generates a first login request including the user identity information and sends the first login request to the CAS proxy server. When the client fails to directly access the first business system, the redirection address can be "https: / / CAS server address?service=proxy address", where "CAS server address" represents the address of the CAS server and "proxy address" represents the address of the CAS proxy server.
[0091] The CAS proxy server sends the first login request to the CAS server. The CAS server generates a first global login ticket and a first service ticket for logging into the first business system based on the user identity information in the first login request, and returns the first global login ticket and the first service ticket to the CAS proxy server.
[0092] Step 320: Receive a first global login ticket returned by the CAS proxy server.
[0093] The first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system.
[0094] After receiving the first global login ticket returned by the CAS server, the CAS proxy server sends the first global login ticket to the client, and the client receives and saves the first global login ticket returned by the CAS proxy server.
[0095] The CAS proxy server transmits the first service ticket returned by the CAS server back to the CAS server, and the CAS server verifies the validity of the first service ticket. After the first service ticket is verified, the domain account corresponding to the first service ticket is obtained and returned to the CAS proxy server.
[0096] The CAS proxy server receives the domain account sent by the CAS server, generates a first login permission request including the domain account, and sends the first login permission request to the first gateway server corresponding to the first business system; the first gateway server calls the first business system to generate a first user token (Token) according to the domain account in the first login permission request, writes the first user token into the cache of the first business system, and sends the first user token to the client to notify the client to write the first user token into the first text file.
[0097] Step 330, receiving a first user token sent by a first gateway server corresponding to the first business system, and writing the first user token into a first text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information.
[0098] The client receives the first user token sent by the first gateway server corresponding to the first business system, and writes the first user token into the first text file, that is, the client writes the first user token into the root domain name of the first business system in the form of a small text file (Cookies). The client can subsequently access the first business system based on the first user token in the first text file.
[0099] Step 340: obtain the first user token from the first text file, generate a first access request including the first user token, send the first access request to the first business system, and receive the requested resource returned by the first business system.
[0100] The first user token is located in the header of the first access request.
[0101] The client obtains the required data from the first business system through the API (Application Programming Interface) in the front-end page corresponding to the first business system, that is, obtains the first user token from the first text file, and generates a first access request including the first user token. The first user token can be placed in the header of the first access request, that is, the first user token is transmitted in the form of JWT, and the first access request is sent to the first business system. The first business system intercepts the first user token in the first access request, and after authenticating the first user token and other operations, the requested data is returned to the client.
[0102] By placing the first user token into the header of the first access request, the global login ticket and service ticket used by the CAS server to interact with the business system (backend) are converted into the common JWT information in the front-end and back-end separation project, so that the common front-end and back-end separation architecture does not have to pay attention to the entire single sign-on interaction details and can adapt to the complete single sign-on function.
[0103] The single sign-on method provided in this embodiment is that when the client fails to access the first business system, the client sends a first login request for the first business system to the CAS proxy server, and the CAS proxy server interacts with the CAS server to verify the user identity information of the client. After the verification is successful, the CAS proxy server sends the domain account returned by the CAS server to the first gateway server, and the first gateway server generates a first user token based on the domain account, writes the first user token into the cache of the first business system, and writes the first user token into the first text file of the client, thereby realizing the client's login to the first business system. The CAS proxy server performs authentication operations based on the client's request, and the client does not need to simulate modes such as authorization code, authentication client and password, which is conducive to protecting sensitive data such as user identity information and improving the security of sensitive data. In addition, there is no need to integrate the CAS client in the business system, which realizes the complete decoupling of the business system and the CAS service, makes it easy to expand other business systems, and improves the scalability of the business in the single sign-on.
[0104] On the basis of the above technical solution, after writing the first user token into the first text file, the method further includes: in response to the user's logout operation, sending a logout request for the first business system to the CAS proxy server, the logout request including the user identity information, and the logout request being used to request the CAS proxy server to interact with the CAS server to perform the logout operation of the user identity information for the first business system; receiving a token clearing request sent by the first gateway server, and clearing the first user token under the first text file, the token clearing request being sent by the first gateway server based on a logout permission request, and the logout permission request being sent by the CAS proxy server to the first gateway server.
[0105] When the user logs out of the first business system in the client, the client sends a logout request to the CAS proxy server. After receiving the logout request sent by the client, the CAS proxy server sends the logout request to the CAS server. The CAS server executes the logout operation of the user identity information for the first business system. After the logout operation is completed, the CAS server calls back the CAS proxy server. Based on the callback request of the CAS server, the CAS proxy server sends a logout permission request to the first gateway server to notify the first gateway server to perform the logout operation. The first gateway server clears the first user token in the cache of the first business system and sends a token clearing request to the client to clear the first user token under the first text file in the client. The client receives the token clearing request sent by the first gateway server and clears the first user token under the first text file.
[0106] The client sends a logout request to the CAS proxy server, and the CAS proxy server executes the client's logout operation on the first business system based on the client's logout request, thereby realizing the front-end logout in the front-end and back-end separation project, and solving the problem that the native front-end and back-end separation projects in the prior art do not have the login and logout capabilities.
[0107] On the basis of the above technical solution, after writing the first user token into the first text file, the method further includes:
[0108] In the case of logging into the first business system, redirecting and sending a second login request for the second business system to the CAS proxy server, the second login request including the first global login ticket, the second login request being used to request the CAS proxy server to interact with the CAS server to verify the validity of a second service ticket corresponding to the first global login ticket, the second service ticket being used as a credential for the client to log into the second business system;
[0109] Receive a second user token sent by the second gateway server corresponding to the second business system, and write the second user token into a second text file, wherein the second user token is generated by the second gateway server according to the domain account, and the domain account is sent to the second gateway server after the CAS proxy server and the CAS server verify the second service ticket corresponding to the first global login ticket.
[0110] The second business system is a system associated with the first business system, and the root domain name corresponding to the second business system and the root domain name corresponding to the first business system are the same root domain name.
[0111] When the client successfully logs in to the first business system, when accessing the second business system based on the first business system, based on the redirection address pre-configured in the client for accessing the second business system based on the first business system, the client sends a second login request for the second business system to the CAS proxy server under the first business system (such as the page of the first business system or the link of the second business system collected in the first business system), and includes the first global login ticket when logging in to the first business system in the second login request. Among them, the redirection address can be expressed as "http: / / proxy address?url=service jump address", the proxy address is the address of the CAS proxy server, and the service jump address is the real request resource address, that is, the address of the second business system.
[0112] After the CAS proxy server receives the second login request sent by the client, it sends the second login request to the CAS server. The CAS server obtains the first global login ticket under the root domain name from the second login request, and finds the TGT corresponding to the first global login ticket based on the first global login ticket. It generates a second service ticket based on the TGT and sends the second service ticket to the CAS proxy server. The CAS proxy server sends a second verification request including the second service ticket to the CAS server. The CAS server verifies the second service ticket. After the second service ticket is verified, the CAS server informs the CAS proxy server that the user identity information has been logged in and returns the domain account.
[0113] The CAS proxy server receives the domain account returned by the CAS server, generates a second login permission request including the domain account, and sends the second login permission request to the second gateway server corresponding to the second business system; the second gateway server calls the second business system according to the domain account in the second login permission request to generate a second user token (Token), writes the second user token into the cache of the second business system, and sends the second user token to the client, notifying the client to write the second user token into the second text file, that is, the client writes the second user token into the root domain name of the second business system in the form of a small text file (Cookies). The client can subsequently access the second business system based on the second user token in the second text file.
[0114] When the client logs in to the first business system, when logging in to the second business system, the second business system can be logged in directly based on the user identity information in the first business system, thereby avoiding the user from inputting the user identity information again.
[0115] On the basis of the above technical solution, before sending the first login request for the first business system to the proxy server, the method also includes: in the third business system, redirecting and sending a third login request for the first business system to the CAS proxy server, the third login request includes a second global login ticket for logging into the third business system, the third login request is used to request the CAS proxy server and the CAS server to interact to verify the validity of a third service ticket corresponding to the second global login ticket, the second global login ticket is saved to the client when the client logs into the third business system; receiving a file clearing request sent by the CAS proxy server, and clearing a third text file corresponding to the third business system, the file clearing request is generated by the CAS proxy server based on the logout information returned by the CAS server when the third service ticket fails to be verified.
[0116] The third business system is a system associated with the first business system, and the root domain name corresponding to the third business system and the root domain name corresponding to the first business system are the same root domain name.
[0117] When the client accesses the first business system through the third business system, based on the redirection address for accessing the first business system based on the third business system pre-configured in the client, the client sends a third login request for the first business system to the CAS proxy server under the third business system (such as the page of the third business system or the link of the second business system collected in the third business system), and includes the second global login ticket when logging into the third business system in the third login request. Among them, the redirection address can be expressed as "http: / / proxy address?url=service jump address", the proxy address is the address of the CAS proxy server, and the service jump address is the real request resource address, that is, the address of the first business system.
[0118] After the CAS proxy server receives the third login request sent by the client, it sends the third login request to the CAS server. The CAS server obtains the second global login ticket under the root domain name from the third login request, and finds the TGT corresponding to the second global login ticket based on the second global login ticket. It generates a third service ticket based on the TGT and sends the third service ticket to the CAS proxy server. The CAS proxy server sends a third verification request including the third service ticket to the CAS server. The CAS server verifies the validity of the third service ticket. After verification, it determines that the client has logged out of the third business system, that is, the third service ticket has not been verified. At this time, the CAS server returns the logout information to the CAS proxy server.
[0119] After receiving the logout information returned by the CAS server, the CAS proxy server generates a file clearing request and sends the file clearing request to the client. Based on the file clearing request sent by the CAS proxy server, the client clears the third text file corresponding to the third business system, and then redirects to the CAS proxy server to request to log in to the first business system.
[0120] When the client logs out of the third business system, when accessing the first business system based on the third business system, the CAS proxy server determines that the client has logged out when interacting with the CAS server to perform identity authentication. At this time, the third text file is cleared, so that other related systems can be logged out at the same time when one system is logged out.
[0121] Based on the above technical solution, before sending the first login request for the first business system to the proxy server, it also includes: sending a second access request to the first business system, and receiving an unlogged-in status code returned by the first business system, wherein the unlogged-in status is returned when the first business system determines that the client has not logged in to the first business system.
[0122] The user accesses the first business system through WAF (Web Application Firewall) via a terminal such as a computer (PC) or a mobile phone (M). The front-end page passes the second access request to the back-end business service of the first business system. At this time, the first business system verifies whether the resource requested by the user is protected. If the resource requested by the second access request is a non-protected resource, the requested resource is returned. If the resource requested by the second access request is a protected resource, JWT is extracted from the second access request, and the user identity information is verified based on JWT (i.e., user token). If it is verified that the user is a legally authorized user and has access rights, the requested resource is returned. If it is verified that the user is an unauthorized user or does not have access rights, access is denied. If JWT does not exist in the second access request, it is determined that the user is not logged in, and a non-logged in status code is returned.
[0123] The client redirects to the SSO service based on the non-logged-in status code, that is, replaces the address for accessing the first business system with the pre-configured redirection address "https: / / CAS server address?service=proxy address", and subsequently executes steps 310 to 340 of the above solution.
[0124] The client accesses the first business system. After the first business system verifies the user identity information of the client, if it determines that the client has not logged in to the first business system, it returns a not logged in status code. The client can send a first login request to the CAS proxy server based on the redirection address, and log in to the first business system after interactive verification between the CAS proxy server and the CAS server to obtain resources in the first business system.
[0125] Figure 4 is a flow chart of a single sign-on method provided in an embodiment of the present application, such as Figure 4 As shown, the method includes steps 410 to 480.
[0126] Step 410: When the client fails to access the first business system, the client redirects and sends a first login request for the first business system to the CAS proxy server, where the first login request includes user identity information.
[0127] Step 420: The CAS proxy server sends the first login request to the CAS server.
[0128] Step 430: The CAS server generates a first global login ticket and a first service ticket according to the user identity information, and sends the first global login ticket and the first service ticket to the CAS proxy server.
[0129] The first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket. The first service ticket is used as a credential for the client to log in to the first business system.
[0130] In step 440, the CAS proxy server sends the first global login ticket to the client, and sends a first verification request including the first service ticket to the CAS server.
[0131] In step 450, the CAS server verifies the validity of the first service ticket, and after the first service ticket is verified, sends the domain account corresponding to the user identity information to the CAS proxy server.
[0132] Step 460: The CAS proxy server generates a first login permission request including the domain account, and sends the first login permission request to the first gateway server.
[0133] Step 470: The first gateway server generates a first user token according to the domain account, writes the first user token into the cache of the first business system, and writes the first user token into a first text file of the client.
[0134] Step 480: The client accesses the first business system based on the first user token.
[0135] Optionally, after the client accesses the first business system based on the first user token, the method further includes:
[0136] In response to a logout operation of the user, the client sends a logout request for the first business system to the CAS proxy server, where the logout request includes the user identity information;
[0137] The CAS proxy server sends the logout request to the CAS server;
[0138] The CAS server executes a logout operation of the user identity information for the first business system and calls back the CAS proxy server;
[0139] The CAS proxy server sends a logout permission request to the first gateway server based on the callback request of the CAS server;
[0140] The first gateway server clears the first user token in the first business system cache and clears the first user token under the first text file.
[0141] Optionally, after the client accesses the first business system based on the first user token, the method further includes:
[0142] When logging into the first business system, the client redirects the CAS proxy server to send a second login request for a second business system, where the second login request includes the first global login ticket;
[0143] The CAS proxy server sends the second login request to the CAS server, receives a second service ticket returned by the CAS server based on the first global login ticket, and sends a second verification request including the second service ticket to the CAS server, where the second service ticket is used as a credential for the client to log in to the second business system;
[0144] The CAS server verifies the validity of the second service ticket and returns the domain account after the second service ticket is verified;
[0145] The CAS proxy server generates a second login permission request including the domain account, and sends the second login permission request to a second gateway server corresponding to the second business system;
[0146] The second gateway server generates a second user token according to the domain account, writes the second user token into a cache of the second business system, and writes the second user token into a second text file of the client;
[0147] The client accesses the second business system based on the second user token.
[0148] Optionally, before the client redirects the first login request for the first business system to the CAS proxy server when the access to the first business system fails, the method further includes:
[0149] The client, in the third business system, redirects and sends a third login request for the first business system to the CAS proxy server, wherein the third login request includes a second global login ticket for logging into the third business system, and the second global login ticket is saved in the client when the client logs into the third business system;
[0150] The CAS proxy server sends the third login request to the CAS server, receives a third service ticket returned by the CAS server based on the second global login ticket, and sends a third verification request including the third service ticket to the CAS server;
[0151] The CAS server verifies the validity of the third service ticket, and returns logout information to the CAS proxy server when the third service ticket fails to pass the verification;
[0152] The CAS proxy server generates a file clearing request according to the logout information, and sends the file clearing request to the client;
[0153] The client clears the third text file corresponding to the third business system.
[0154] Optionally, the first user token is located in a header of the first access request.
[0155] It should be noted that the specific content of the above steps is the same as the relevant content in the aforementioned embodiment. The relevant content can be found in the aforementioned embodiment and will not be repeated here.
[0156] The single sign-on method provided in this embodiment is that the CAS proxy server receives a first login request sent by the client and interacts with the CAS server to verify the user identity information of the client. After the verification is passed, the CAS proxy server generates a first login permission request based on the domain account returned by the CAS server, and sends the first login permission request to the first gateway server. The first gateway server generates a first user token based on the domain account in the first login permission request, writes the first user token into the cache of the first business system, and writes the first user token into the first text file of the client, thereby realizing the single sign-on of the client to the first business system. The CAS proxy server interacts with the CAS server based on the request of the client to perform a single sign-on authentication operation. The client does not need to simulate modes such as authorization code, authentication client and password, which is conducive to protecting sensitive data such as user identity information and improving the security of sensitive data. In addition, there is no need to integrate the CAS client in the business system, thereby realizing the complete decoupling of the business system and the CAS service, making it easy to expand other business systems, and improving the scalability of the business in the single sign-on.
[0157] Figure 5 is a schematic diagram of the structure of a single sign-on system provided by an embodiment of the present invention, such as Figure 4 As shown, the single sign-on system includes a client 510 , a first business system 520 , a CAS proxy server 530 , a CAS server 540 and a first gateway server 550 .
[0158] The client 510 is used to redirect and send a first login request for the first business system to the CAS proxy server 530 when access to the first business system 520 fails, wherein the first login request includes user identity information;
[0159] The CAS proxy server 530 is used to send the first login request to the CAS server 540;
[0160] The CAS server 540 is used to generate a first global login ticket and a first service ticket according to the user identity information, and send the first global login ticket and the first service ticket to the CAS proxy server 430, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0161] The CAS proxy server 530 is further configured to send the first global login ticket to the client 510, and send the first verification request including the first service ticket to the CAS server 540;
[0162] The CAS server 540 is also used to verify the validity of the first service ticket, and after the first service ticket is verified, send the domain account corresponding to the user identity information to the CAS proxy server 530;
[0163] The CAS proxy server 530 is further configured to generate a first login permission request including the domain account, and send the first login permission request to the first gateway server 550;
[0164] The first gateway server 550 is used to generate a first user token according to the domain account, write the first user token into the cache of the first business system 520, and write the first user token into a first text file of the client 510;
[0165] The client 510 is further configured to access the first business system 520 based on the first user token.
[0166] Optionally, the client 510 is further configured to: in response to a logout operation of the user, send a logout request for the first business system 520 to the CAS proxy server 530, wherein the logout request includes the user identity information;
[0167] The CAS proxy server 530 is further used to: send the logout request to the CAS server 540;
[0168] The CAS server 540 is further used to: execute a logout operation of the user identity information for the first business system, and call back the CAS proxy server;
[0169] The CAS proxy server 530 is further configured to: send a logout permission request to the first gateway server 550 based on the callback request of the CAS server 540;
[0170] The first gateway server 550 is further used to clear the first user token in the first business system cache and clear the first user token under the first text file.
[0171] Optionally, the system further includes a second business system and a second gateway server;
[0172] The client 510 is further configured to: when logging into the first business system, redirect and send a second login request for a second business system to the CAS proxy server, wherein the second login request includes the first global login ticket;
[0173] The CAS proxy server 530 is further configured to: send the second login request to the CAS server 540, and receive a second service ticket returned by the CAS server based on the first global login ticket; send a second verification request including the second service ticket to the CAS server, where the second service ticket is used as a credential for the client to log in to the second business system;
[0174] The CAS server 540 is further configured to verify the validity of the second service ticket and return the domain account after the second service ticket is verified;
[0175] The CAS proxy server 530 is further configured to: generate a second login permission request including the domain account, and send the second login permission request to a second gateway server corresponding to the second business system;
[0176] The second gateway server is used to: generate a second user token according to the domain account, write the second user token into the cache of the second business system, and write the second user token into the second text file of the client 410;
[0177] The client 520 accesses the second business system based on the second user token.
[0178] Optionally, the client is further used to: redirect and send a third login request for the first business system to the CAS proxy server under the third business system, wherein the third login request includes a second global login ticket for logging into the third business system, and the second global login ticket is saved in the client when the client logs into the third business system;
[0179] The CAS proxy server is further configured to: send the third login request to the CAS server, and receive a third service ticket returned by the CAS server based on the second global login ticket; and send a third verification request including the third service ticket to the CAS server;
[0180] The CAS server is also used to: verify the validity of the third service ticket, and return logout information to the CAS proxy server when the third service ticket fails to be verified;
[0181] The CAS proxy server is also used to generate a file clearing request according to the logout information, and send the file clearing request to the client;
[0182] The client is also used to clear the third text file corresponding to the third business system.
[0183] Optionally, the first user token is located in a header of the first access request.
[0184] The single sign-on system provided in this embodiment uses an independent CAS proxy server to interact with the CAS server, handle business identity authentication tasks such as user login and logout, and isolate all interaction processes between the business system and the single sign-on server (i.e., the CAS server). This can not only ensure the integrity of the front-end and back-end separation project, but also enable the front-end and back-end separation project to have a complete single sign-on function, and ensure the scalability of the architecture, and ensure that the front-end and back-end separation project can access the single sign-on service at almost zero cost; by putting the first user token into the header of the first access request, the global login ticket and service ticket used by the CAS server to interact with the business system (back-end) are converted into the common JWT information in the front-end and back-end separation project, so that the common front-end and back-end separation architecture does not need to pay attention to the entire single sign-on interaction details and can adapt to the complete single sign-on function.
[0185] Figure 6 is an example diagram of a single sign-on system under a financial architecture in an embodiment of the present invention. Figure 6As shown, taking the financial architecture as an example, the back-end business system may include a reimbursement system, a payment system, an invoice system, and a contract system. Correspondingly, the front-end (client) Web pages may include a reimbursement Web, a payment Web, an invoice Web, and a contract Web. When a user accesses the financial business front-end system through a computer, mobile phone, or other terminal through WAF, the request is sent to the CAS proxy server. The CAS proxy server interacts with the CAS server to authenticate the user's identity information, and authorizes the client to log in after the authentication is passed. The CAS proxy server sends the user token to the corresponding back-end business system in the form of JWT through the gateway server, and writes it to the client's front-end page. After that, the front-end page can exchange data with the back-end business system based on JWT. When adding a new project, you need to add the business system and the corresponding front-end page corresponding to the project, and you can implement single sign-on based on the CAS proxy server and CAS server, which is the same as Figure 1 In comparison, there is no need to integrate single sign-on in the project, which enables independent deployment of projects in front-end and back-end separation projects and improves the scalability of the business. Figure 1 The general architecture shown needs to simulate CAS authorization and other operations on the front end. This operation is a relatively private operation in the entire system and will expose some information such as keys on the front end. The architecture of the embodiment of the present invention places privacy and security operations on the server side and does not require complex simulation operations, thereby improving security.
[0186] Figure 7 is a schematic diagram of the structure of a single sign-on device provided by an embodiment of the present invention, the single sign-on device is applied to a CAS proxy server, such as Figure 7 As shown, the single sign-on device includes:
[0187] A first request receiving module 610 is used to receive a first login request for a first business system sent by a client, wherein the first login request is sent by the client after being redirected when access to the first business system fails, and the login request includes user identity information;
[0188] a token receiving module 620, configured to send the first login request to a CAS server, and receive a first global login ticket and a first service ticket returned by the CAS server, wherein the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information, the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0189] A token sending module 630 is used to send the first global login ticket to the client, and send a first verification request including the first service ticket to the CAS server; the first verification request is used to request the CAS server to verify the validity of the first service ticket;
[0190] The first domain account forwarding module 640 is used to receive the domain account returned by the CAS server after the first service ticket is verified, generate a first login permission request including the domain account, and send the first login permission request to the first gateway server corresponding to the first business system. The first login permission request is used to request the first gateway server to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client. The client accesses the first business system based on the first user token.
[0191] Optionally, the device further comprises:
[0192] a logout request receiving module, configured to receive a logout request sent by the client to the first business system, wherein the logout request includes the user identity information;
[0193] A logout request forwarding module, used to send the logout request to the CAS server, wherein the logout request is used to request the CAS server to execute a logout operation of the user identity information for the first business system;
[0194] A logout permission module is used to send a logout permission request to the first gateway server based on the callback request of the CAS server, and the logout permission request is used to request the first gateway server to clear the first user token in the cache of the first business system and clear the first user token under the first text file.
[0195] Optionally, the device further comprises:
[0196] A second request receiving module, configured to receive a second login request for a second business system sent by the client, wherein the second login request is sent by the client through redirection when logging into the first business system, and the second login request includes the first global login ticket;
[0197] A second request forwarding module, configured to send the second login request to the CAS server, and receive a second service ticket returned by the CAS server based on the first global login ticket, wherein the second service ticket is used as a credential for the client to log in to the second business system;
[0198] Sending a second verification request including the second service ticket to the CAS server, where the second verification request is used to request the CAS server to verify the validity of the first service ticket;
[0199] The second domain account forwarding module is used to receive the domain account returned by the CAS server after the second service ticket is verified, generate a second login permission request including the domain account, and send the second login permission request to the second gateway server corresponding to the second business system. The second login permission request is used to request the second gateway server to generate a second user token according to the domain account, write the second user token into the cache of the second business system, and write the second user token into the second text file of the client. The client accesses the second business system based on the second user token.
[0200] Optionally, the device further comprises:
[0201] A third request receiving module, configured to receive a third login request for the first business system sent by the client, wherein the third login request is sent by the client through redirection under the third business system, and the third login request includes a second global login ticket for logging into the third business system, and the second global login ticket is saved in the client when the client logs into the third business system;
[0202] a third request forwarding module, configured to send the third login request to the CAS server, and receive a third service ticket returned by the CAS server based on the second global login ticket;
[0203] Sending a third verification request including the third service ticket to the CAS server, wherein the third verification request is used to request the CAS server to verify the validity of the third service ticket;
[0204] The file clearing module is used to receive the logout information returned by the CAS server when the third service ticket is not verified, generate a file clearing request, and send the file clearing request to the client. The file clearing request is used to request the client to clear the third text file corresponding to the third business system and redirect it to the CAS proxy server.
[0205] The single sign-on device provided in this embodiment receives a first login request sent by a client through a CAS proxy server, and interacts with the CAS server to verify the user identity information of the client. After the verification is passed, the CAS proxy server generates a first login permission request based on the domain account returned by the CAS server, and sends the first login permission request to the first gateway server. The first gateway server generates a first user token based on the domain account in the first login permission request, writes the first user token into the cache of the first business system, and writes the first user token into the first text file of the client, thereby realizing the single sign-on of the client to the first business system. The CAS proxy server interacts with the CAS server based on the request of the client to perform a single sign-on authentication operation. The client does not need to simulate modes such as authorization code, authentication client and password, which is conducive to protecting sensitive data such as user identity information and improving the security of sensitive data. In addition, there is no need to integrate the CAS client in the business system, thereby realizing the complete decoupling of the business system and the CAS service, making it easy to expand other business systems, and improving the scalability of the business in the single sign-on.
[0206] Figure 8 is a schematic diagram of the structure of a single sign-on device provided by an embodiment of the present invention, the single sign-on device is applied to a client, such as Figure 8 As shown, the single sign-on device includes:
[0207] A first request sending module 710 is used to send a first login request for the first business system to the CAS proxy server when access to the first business system fails, wherein the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request;
[0208] A global ticket receiving module 720 is used to receive a first global login ticket returned by the CAS proxy server, where the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system;
[0209] A first token storage module 730 is configured to receive a first user token sent by a first gateway server corresponding to the first business system, and write the first user token into a first text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information;
[0210] The access request sending module 740 is used to obtain the first user token from the first text file, generate a first access request including the first user token, send the first access request to the first business system, and receive the requested resources returned by the first business system.
[0211] Optionally, the device further comprises:
[0212] a logout request sending module, configured to send a logout request for the first business system to the CAS proxy server in response to a logout operation of the user, wherein the logout request includes the user identity information, and the logout request is used to request the CAS proxy server to interact with the CAS server to perform a logout operation of the user identity information for the first business system;
[0213] A token clearing module is used to receive a token clearing request sent by the first gateway server and clear the first user token under the first text file. The token clearing request is sent by the first gateway server based on a logout permission request, and the logout permission request is sent by the CAS proxy server to the first gateway server.
[0214] Optionally, the device further comprises:
[0215] A second request sending module is used to redirect and send a second login request for a second business system to the CAS proxy server when logging into the first business system, wherein the second login request includes the first global login ticket, and the second login request is used to request the CAS proxy server to interact with the CAS server to verify the validity of a second service ticket corresponding to the first global login ticket, and the second service ticket is used as a credential for the client to log into the second business system;
[0216] The second token storage module is used to receive a second user token sent by the second gateway server corresponding to the second business system, and write the second user token into a second text file, wherein the second user token is generated by the second gateway server according to the domain account, and the domain account is sent to the second gateway server after the CAS proxy server and the CAS server verify the second service ticket corresponding to the first global login ticket.
[0217] Optionally, the device further comprises:
[0218] A third request sending module is used to redirect and send a third login request for the first business system to the CAS proxy server under a third business system, wherein the third login request includes a second global login ticket for logging into the third business system, and the third login request is used to request the CAS proxy server to interact with the CAS server to verify the validity of a third service ticket corresponding to the second global login ticket, wherein the second global login ticket is saved in the client when the client logs into the third business system;
[0219] The file clearing module is used to receive a file clearing request sent by the CAS proxy server and clear the third text file corresponding to the third business system. The file clearing request is generated by the CAS proxy server based on the logout information returned by the CAS server when the third service ticket is not verified.
[0220] Optionally, the device further comprises:
[0221] The access invalidation module is used to send a second access request to the first business system and receive a non-logged-in status code returned by the first business system, wherein the non-logged-in status is returned when the first business system determines that the client has not logged in to the first business system.
[0222] Optionally, the first user token is located in a header of the first access request.
[0223] The single sign-on device provided in this embodiment sends a first login request for the first business system to the CAS proxy server when the client fails to access the first business system. The CAS proxy server interacts with the CAS server to verify the user identity information of the client. After the verification is successful, the CAS proxy server sends the domain account returned by the CAS server to the first gateway server. The first gateway server generates a first user token based on the domain account, writes the first user token into the cache of the first business system, and writes the first user token into the first text file of the client, thereby realizing the client's login to the first business system. The CAS proxy server performs authentication operations based on the client's request, and the client does not need to simulate modes such as authorization code, authentication client and password, which is conducive to protecting sensitive data such as user identity information and improving the security of sensitive data. In addition, there is no need to integrate the CAS client in the business system, thereby realizing complete decoupling of the business system and the CAS service, making it easy to expand other business systems, and improving the scalability of the business in the single sign-on.
[0224] The embodiment of the present invention further provides an electronic device, such as Fig. 9As shown, it includes a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0225] Memory 803, used for storing computer programs;
[0226] The processor 801 is used to execute the program stored in the memory 803, and implements the following steps:
[0227] receiving a first login request for a first business system sent by a client, wherein the first login request is sent by the client after being redirected when access to the first business system fails, and the login request includes user identity information;
[0228] Sending the first login request to the CAS server, and receiving a first global login ticket and a first service ticket returned by the CAS server, wherein the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information, the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system;
[0229] Sending the first global login ticket to the client, and sending a first verification request including the first service ticket to the CAS server; the first verification request is used to request the CAS server to verify the validity of the first service ticket;
[0230] Receive the domain account returned by the CAS server after the first service ticket is verified, generate a first login permission request including the domain account, and send the first login permission request to the first gateway server corresponding to the first business system, the first login permission request is used to request the first gateway server to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client, and the client accesses the first business system based on the first user token.
[0231] Optionally, after sending the first login permission request to the first gateway server corresponding to the first business system, the method further includes:
[0232] receiving a logout request for the first business system sent by the client, wherein the logout request includes the user identity information;
[0233] Sending the logout request to the CAS server, where the logout request is used to request the CAS server to execute a logout operation of the user identity information for the first business system;
[0234] Based on the callback request of the CAS server, a logout permission request is sent to the first gateway server, and the logout permission request is used to request the first gateway server to clear the first user token in the first business system cache and clear the first user token under the first text file.
[0235] Optionally, after sending the first login permission request to the first gateway server corresponding to the first business system, the method further includes:
[0236] receiving a second login request for a second business system sent by the client, where the second login request is sent by the client through redirection when logging into the first business system, and the second login request includes the first global login ticket;
[0237] Sending the second login request to the CAS server, and receiving a second service ticket returned by the CAS server based on the first global login ticket, wherein the second service ticket is used as a credential for the client to log in to the second business system;
[0238] Sending a second verification request including the second service ticket to the CAS server, where the second verification request is used to request the CAS server to verify the validity of the second service ticket;
[0239] Receive the domain account returned by the CAS server after the second service ticket is verified, generate a second login permission request including the domain account, and send the second login permission request to the second gateway server corresponding to the second business system, the second login permission request is used to request the second gateway server to generate a second user token based on the domain account, write the second user token into the cache of the second business system, and write the second user token into the second text file of the client, and the client accesses the second business system based on the second user token.
[0240] Optionally, before receiving the first login request for the first business system sent by the client, the method further includes:
[0241] receiving a third login request for the first business system sent by the client, the third login request being sent by the client through redirection under the third business system, the third login request including a second global login ticket for logging into the third business system, the second global login ticket being saved in the client when the client logs into the third business system;
[0242] Sending the third login request to the CAS server, and receiving a third service ticket returned by the CAS server based on the second global login ticket;
[0243] Sending a third verification request including the third service ticket to the CAS server, wherein the third verification request is used to request the CAS server to verify the validity of the third service ticket;
[0244] Receive the logout information returned by the CAS server when the third service ticket is not verified, generate a file clearing request, and send the file clearing request to the client, wherein the file clearing request is used to request the client to clear the third text file corresponding to the third business system and redirect it to the CAS proxy server.
[0245] Alternatively, the processor 801, when used to execute the program stored in the memory 803, implements the following steps:
[0246] When access to the first business system fails, sending a first login request for the first business system to the CAS proxy server, where the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request;
[0247] Receive a first global login ticket returned by the CAS proxy server, where the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system;
[0248] receiving a first user token sent by a first gateway server corresponding to the first business system, and writing the first user token into a first text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information;
[0249] The first user token is obtained from the first text file, and a first access request including the first user token is generated, the first access request is sent to the first business system, and the requested resource is received from the first business system.
[0250] Optionally, after writing the first user token into the first text file, the method further includes:
[0251] In response to a logout operation of the user, sending a logout request for the first business system to the CAS proxy server, wherein the logout request includes the user identity information, and the logout request is used to request the CAS proxy server to interact with the CAS server to perform a logout operation of the user identity information for the first business system;
[0252] Receive a token clearing request sent by the first gateway server, and clear the first user token under the first text file, wherein the token clearing request is sent by the first gateway server based on a logout permission request, and the logout permission request is sent by the CAS proxy server to the first gateway server.
[0253] Optionally, after writing the first user token into the first text file, the method further includes:
[0254] In the case of logging into the first business system, redirecting and sending a second login request for the second business system to the CAS proxy server, the second login request including the first global login ticket, the second login request being used to request the CAS proxy server to interact with the CAS server to verify the validity of a second service ticket corresponding to the first global login ticket, the second service ticket being used as a credential for the client to log into the second business system;
[0255] Receive a second user token sent by the second gateway server corresponding to the second business system, and write the second user token into a second text file, wherein the second user token is generated by the second gateway server according to the domain account, and the domain account is sent to the second gateway server after the CAS proxy server and the CAS server verify the second service ticket corresponding to the first global login ticket.
[0256] Optionally, before sending the first login request for the first business system to the proxy server, the method further includes:
[0257] Under the third business system, redirect and send a third login request for the first business system to the CAS proxy server, the third login request including a second global login ticket for logging into the third business system, the third login request is used to request the CAS proxy server to interact with the CAS server to verify the validity of a third service ticket corresponding to the second global login ticket, the second global login ticket is saved in the client when the client logs into the third business system;
[0258] Receive a file clearing request sent by the CAS proxy server, and clear the third text file corresponding to the third business system, wherein the file clearing request is generated by the CAS proxy server based on the logout information returned by the CAS server when the third service ticket is not verified.
[0259] Optionally, before sending the first login request for the first business system to the proxy server, the method further includes:
[0260] A second access request is sent to the first business system, and a non-logged-in status code is received from the first business system, where the non-logged-in status code is returned when the first business system determines that the client is not logged in to the first business system.
[0261] Optionally, the first user token is located in a header of the first access request.
[0262] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0263] The communication interface is used for communication between the above electronic device and other devices.
[0264] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0265] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0266] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the single sign-on method described in any one of the above embodiments.
[0267] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is executed on a computer, the computer executes the single sign-on method described in any one of the above embodiments.
[0268] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0269] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0270] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0271] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A single sign-on method, characterized in that: Applicable to CAS proxy server, including: receiving a first login request for a first business system sent by a client, wherein the first login request is sent by the client after being redirected when access to the first business system fails, and the login request includes user identity information; Sending the first login request to the CAS server, and receiving a first global login ticket and a first service ticket returned by the CAS server, wherein the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information, the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system; Sending the first global login ticket to the client, and sending a first verification request including the first service ticket to the CAS server; the first verification request is used to request the CAS server to verify the validity of the first service ticket; Receive the domain account returned by the CAS server after the first service ticket is verified, generate a first login permission request including the domain account, and send the first login permission request to the first gateway server corresponding to the first business system, the first login permission request is used to request the first gateway server to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client, and the client accesses the first business system based on the first user token.
2. The method according to claim 1, characterized in that: After sending the first login permission request to the first gateway server corresponding to the first business system, the method further includes: receiving a logout request for the first business system sent by the client, wherein the logout request includes the user identity information; Sending the logout request to the CAS server, wherein the logout request is used to request the CAS server to execute a logout operation of the user information for the first business system; Based on the callback request of the CAS server, a logout permission request is sent to the first gateway server, and the logout permission request is used to request the first gateway server to clear the first user token in the first business system cache and clear the first user token under the first text file.
3. The method according to claim 1, characterized in that After sending the first login permission request to the first gateway server corresponding to the first business system, the method further includes: receiving a second login request for a second business system sent by the client, where the second login request is sent by the client through redirection when logging into the first business system, and the second login request includes the first global login ticket; Sending the second login request to the CAS server, and receiving a second service ticket returned by the CAS server based on the first global login ticket, wherein the second service ticket is used as a credential for the client to log in to the second business system; Sending a second verification request including the second service ticket to the CAS server, where the second verification request is used to request the CAS server to verify the validity of the second service ticket; Receive the domain account returned by the CAS server after the second service ticket is verified, generate a second login permission request including the domain account, and send the second login permission request to the second gateway server corresponding to the second business system, the second login permission request is used to request the second gateway server to generate a second user token based on the domain account, write the second user token into the cache of the second business system, and write the second user token into the second text file of the client, and the client accesses the second business system based on the second user token.
4. The method according to claim 1, characterized in that: Before receiving the first login request for the first business system sent by the client, the method further includes: receiving a third login request for the first business system sent by the client, the third login request being sent by the client through redirection in the third business system, the third login request including a second global login ticket for logging into the third business system, the second global login ticket being saved in the client when the client logs into the third business system; Sending the third login request to the CAS server, and receiving a third service ticket returned by the CAS server based on the second global login ticket; Sending a third verification request including the third service ticket to the CAS server, wherein the third verification request is used to request the CAS server to verify the validity of the third service ticket; Receive the logout information returned by the CAS server when the third service ticket is not verified, generate a file clearing request, and send the file clearing request to the client, wherein the file clearing request is used to request the client to clear the third text file corresponding to the third business system and redirect it to the CAS proxy server.
5. A single sign-on method, characterized in that: Applied to the client, including: When access to the first business system fails, sending a first login request for the first business system to the CAS proxy server, where the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request; Receive a first global login ticket returned by the CAS proxy server, where the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system; receiving a first user token sent by a first gateway server corresponding to the first business system, and writing the first user token into a first text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information; The first user token is obtained from the first text file, and a first access request including the first user token is generated, the first access request is sent to the first business system, and the requested resource is received from the first business system.
6. The method according to claim 5, characterized in that After writing the first user token into the first text file, the method further includes: In response to a logout operation of the user, sending a logout request for the first business system to the CAS proxy server, wherein the logout request includes the user identity information, and the logout request is used to request the CAS proxy server to interact with the CAS server to perform a logout operation of the user identity information for the first business system; Receive a token clearing request sent by the first gateway server, and clear the first user token under the first text file, wherein the token clearing request is sent by the first gateway server based on a logout permission request, and the logout permission request is sent by the CAS proxy server to the first gateway server.
7. The method according to claim 5, characterized in that After writing the first user token into the first text file, the method further includes: In the case of logging into the first business system, redirecting and sending a second login request for the second business system to the CAS proxy server, the second login request including the first global login ticket, the second login request being used to request the CAS proxy server to interact with the CAS server to verify the validity of a second service ticket corresponding to the first global login ticket, the second service ticket being used as a credential for the client to log into the second business system; Receive a second user token sent by the second gateway server corresponding to the second business system, and write the second user token into a second text file, wherein the second user token is generated by the second gateway server according to the domain account, and the domain account is sent to the second gateway server after the CAS proxy server and the CAS server verify the second service ticket corresponding to the first global login ticket.
8. The method according to claim 5, characterized in that Before sending the first login request for the first business system to the proxy server, the method further includes: Under the third business system, redirect and send a third login request for the first business system to the CAS proxy server, the third login request including a second global login ticket for logging into the third business system, the third login request is used to request the CAS proxy server to interact with the CAS server to verify the validity of a third service ticket corresponding to the second global login ticket, the second global login ticket is saved in the client when the client logs into the third business system; Receive a file clearing request sent by the CAS proxy server, and clear the third text file corresponding to the third business system, wherein the file clearing request is generated by the CAS proxy server based on the logout information returned by the CAS server when the third service ticket is not verified.
9. The method according to claim 5, characterized in that Before sending the first login request for the first business system to the proxy server, the method further includes: A second access request is sent to the first business system, and a non-logged-in status code is received from the first business system, where the non-logged-in status code is returned when the first business system determines that the client is not logged in to the first business system.
10. The method according to claim 5, characterized in that The first user token is located in a header of the first access request.
11. A single sign-on method, characterized in that: include: When the client fails to access the first business system, the client redirects the CAS proxy server to send a first login request for the first business system, where the first login request includes user identity information; The CAS proxy server sends the first login request to the CAS server; The CAS server generates a first global login ticket and a first service ticket according to the user identity information, and sends the first global login ticket and the first service ticket to the CAS proxy server, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system; The CAS proxy server sends the first global login ticket to the client, and sends a first verification request including the first service ticket to the CAS server; The CAS server verifies the validity of the first service ticket, and after the first service ticket is verified, sends the domain account corresponding to the user identity information to the CAS proxy server; The CAS proxy server generates a first login permission request including the domain account, and sends the first login permission request to the first gateway server; The first gateway server generates a first user token according to the domain account, writes the first user token into a cache of the first business system, and writes the first user token into a first text file of the client; The client accesses the first business system based on the first user token.
12. The method according to claim 11, characterized in that After the client accesses the first business system based on the first user token, the method further includes: In response to a logout operation of the user, the client sends a logout request for the first business system to the CAS proxy server, where the logout request includes the user identity information; The CAS proxy server sends the logout request to the CAS server; The CAS server executes a logout operation of the user identity information for the first business system and calls back the CAS proxy server; The CAS proxy server sends a logout permission request to the first gateway server based on the callback request of the CAS server; The first gateway server clears the first user token in the first business system cache and clears the first user token under the first text file.
13. The method according to claim 11, characterized in that After the client accesses the first business system based on the first user token, the method further includes: When logging into the first business system, the client redirects the CAS proxy server to send a second login request for a second business system, where the second login request includes the first global login ticket; The CAS proxy server sends the second login request to the CAS server, receives a second service ticket returned by the CAS server based on the first global login ticket, and sends a second verification request including the second service ticket to the CAS server, where the second service ticket is used as a credential for the client to log in to the second business system; The CAS server verifies the validity of the second service ticket and returns the domain account after the second service ticket is verified; The CAS proxy server generates a second login permission request including the domain account, and sends the second login permission request to a second gateway server corresponding to the second business system; The second gateway server generates a second user token according to the domain account, writes the second user token into a cache of the second business system, and writes the second user token into a second text file of the client; The client accesses the second business system based on the second user token.
14. The method according to claim 11, characterized in that Before the client redirects the first login request for the first business system to the CAS proxy server when the access to the first business system fails, the method further includes: The client, in the third business system, redirects and sends a third login request for the first business system to the CAS proxy server, wherein the third login request includes a second global login ticket for logging into the third business system, and the second global login ticket is saved in the client when the client logs into the third business system; The CAS proxy server sends the third login request to the CAS server, receives a third service ticket returned by the CAS server based on the second global login ticket, and sends a third verification request including the third service ticket to the CAS server; The CAS server verifies the validity of the third service ticket, and returns logout information to the CAS proxy server when the third service ticket fails to pass the verification; The CAS proxy server generates a file clearing request according to the logout information, and sends the file clearing request to the client; The client clears the third text file corresponding to the third business system.
15. The method according to claim 11, characterized in that The first user token is located in a header of the first access request.
16. A single sign-on system, characterized in that: include: Client, first business system, CAS proxy server, CAS server and first gateway server; Wherein, the client is used to redirect and send a first login request for the first business system to the CAS proxy server when access to the first business system fails, and the first login request includes user identity information; The CAS proxy server is used to send the first login request to the CAS server; The CAS server is used to generate a first global login ticket and a first service ticket according to the user identity information, and send the first global login ticket and the first service ticket to the CAS proxy server, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system; The CAS proxy server is further configured to send the first global login ticket to the client, and send the first service ticket to the CAS server; The CAS server is also used to verify the validity of the first service ticket, and after the first service ticket is verified, send the domain account corresponding to the user identity information to the CAS proxy server; The CAS proxy server is further configured to generate a first login permission request including the domain account, and send the first login permission request to the first gateway server; The first gateway server is used to generate a first user token according to the domain account, write the first user token into the cache of the first business system, and write the first user token into a first small text file of the client; The client is also used to access the first business system based on the first user token.
17. A single sign-on device, characterized in that: Applicable to CAS proxy server, including: A first request receiving module, configured to receive a first login request for a first business system sent by a client, wherein the first login request is sent by the client after being redirected when access to the first business system fails, and the login request includes user identity information; a token receiving module, configured to send the first login request to the CAS server, and receive a first global login ticket and a first service ticket returned by the CAS server, wherein the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information, the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system, and the first service ticket is a one-time ticket, and the first service ticket is used as a credential for the client to log in to the first business system; a token sending module, configured to send the first global login ticket to the client, and to send a first verification request including the first service ticket to the CAS server; the first verification request is used to request the CAS server to verify the validity of the first service ticket; A domain account forwarding module is used to receive the domain account returned by the CAS server after the first service ticket is verified, generate a first login permission request including the domain account, and send the first login permission request to the first gateway server corresponding to the first business system. The first login permission request is used to request the first gateway server to generate a first user token based on the domain account, write the first user token into the cache of the first business system, and write the first user token into the first text file of the client. The client accesses the first business system based on the first user token.
18. A single sign-on device, characterized in that: Applied to the client, including: A first request sending module, configured to send a first login request for the first business system to the CAS proxy server when access to the first business system fails, wherein the first login request is used to request the CAS proxy server and the CAS server to interactively verify the user identity information in the first login request; A global ticket receiving module, configured to receive a first global login ticket returned by the CAS proxy server, wherein the first global login ticket is used as a credential for the client to log in to other business systems associated with the first business system; A user token storage module is configured to receive a first user token sent by a first gateway server corresponding to the first business system, and write the first user token into a first small text file, wherein the first user token is generated by the first gateway server according to a domain account, and the domain account is sent to the first gateway server after the CAS proxy server and the CAS server verify the first service ticket corresponding to the first global login ticket, and the first global login ticket and the first service ticket are generated by the CAS server based on the user identity information; An access request sending module is used to obtain the first user token from the first text file, generate a first access request including the first user token, send the first access request to the first business system, and receive the requested resources returned by the first business system.
19. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when used to execute a program stored in a memory, implements the method steps described in any one of claims 1-4 or implements the method steps described in any one of claims 5-10.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 4 or the method described in any one of claims 5 to 10 is implemented.
