A request proxy method, client device and proxy service device
By installing the proxy plug-in on the browser, automatically obtaining and verifying the authentication credentials of the proxy server authorization, the security and efficiency problems of browser proxy services in the prior art are solved, and higher security and efficiency are achieved.
Patent Information
- Application Number
- CN202110572059.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-25
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-05-25
AI Technical Summary
The existing browser proxy service has problems of low security and low efficiency. Manually configured login authentication information is easily leaked, and it needs to be manually updated when the authentication information is changed, which affects efficiency.
By installing the proxy plug-in on the browser, the authentication credentials authorized by the proxy server are automatically obtained from the list of cookie information cached by the browser, verify its validity, and enable the proxy service when it is valid. If it is invalid, the user will be prompted to log in to authentication to ensure authentication The security and timely update of the certificates.
Improve the security and efficiency of browser proxy services, avoid the risk of manual configuration, ensure the security of access sessions, and promptly update the authentication credentials to deal with changes in user status.
Smart Images

Figure CN113190828B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of proxy services, and in particular to a request proxy method, a client device and a proxy service device. Background Art
[0002] When using a proxy server to provide proxy services to a browser, the proxy server needs to first authenticate the identity information of the browser user. After the authentication is passed, the proxy server can then proxy the request sent by the browser. In the existing browser proxy authentication, when the browser needs to access the target server through the proxy server, the proxy server is manually configured on the browser to specify the login authentication information for the browser user. When the browser establishes a connection with the target site through the proxy server, the login authentication information is directly obtained from the local browser configuration information and carried in the connection establishment request and sent to the proxy server. The proxy server authenticates the browser user's account based on the login authentication information. If the authentication is passed, a connection is established with the target server, and then the request sent by the browser to the target server is proxyed.
[0003] However, in the above-mentioned proxy service process, since the login authentication information pre-configured manually can be viewed in plain text by other users using the browser, there is a risk of leakage, which makes the security of the proxy service low. In addition, since the login authentication information is fixed, when it changes, it needs to be manually reconfigured on the browser for synchronous update, which affects the efficiency of the proxy service. Summary of the invention
[0004] In order to solve the problems of low security and service efficiency of existing browser proxy services, an embodiment of the present invention provides a request proxy method, a client device and a proxy service device.
[0005] In the first aspect, an embodiment of the present invention provides a request proxy method, which is applied to a proxy plug-in, and the method includes: when the browser completes loading of the proxy plug-in, obtaining the authentication credentials authorized by the proxy server from the cookie information list cached by the browser, and verifying the validity of the authentication credentials; if it is determined that the authentication credentials are valid, enabling the proxy service for the browser so that the access request issued by the browser is received by the proxy server; if it is determined that the authentication credentials are invalid, displaying a login authentication prompt to the user through the browser, and after the login authentication is completed, returning to execute the step of obtaining the authentication credentials; when the browser needs to provide the authentication credentials to the proxy server, providing the obtained valid authentication credentials to the browser, so that the proxy server performs identity authentication based on the valid authentication credentials.
[0006] In the request proxy method provided by the embodiment of the present invention, when the browser completes loading of the proxy plug-in, the proxy plug-in obtains the authentication credential authorized by the proxy server from the Cookie information list cached by the browser, and verifies the validity of the authentication credential. If it is determined that the authentication credential is valid, the proxy plug-in starts the proxy service for the browser, so that the subsequent access request sent by the browser is received by the proxy server, and the proxy server provides the proxy service. If it is determined that the authentication credential is invalid, the browser displays a login authentication prompt to the user to remind the user to obtain a valid authentication credential by completing the login authentication. In this way, the proxy plug-in can return to execute the C from the browser cache after the login authentication is completed. The invention relates to a step of obtaining the authentication credentials authorized by the proxy server from the ookie information list; when the browser needs to provide the authentication credentials to the proxy server, the proxy plug-in provides the obtained valid authentication credentials to the browser, so that the browser provides the valid authentication credentials to the proxy server, and the proxy server performs identity authentication on the access request based on the valid authentication credentials. Compared with the prior art, the present invention installs and loads the proxy plug-in on the browser, realizes automatic proxy authentication and switch control of the proxy function through the proxy plug-in, and does not need to pre-configure fixed user credentials (such as user name and password) on the browser, thereby ensuring the security of the access session and improving the service efficiency of the browser proxy service.
[0007] In a preferred implementation manner, the obtaining of the authentication credentials authorized by the proxy server from the Cookie information list cached by the browser specifically includes: querying the authentication credentials that meet preset conditions from the Cookie information list.
[0008] In a preferred implementation, the validity period of the authentication credential is stored in the Cookie information list, and the verification of the validity of the authentication credential specifically includes: judging whether the authentication credential has expired based on the current system time and the validity period of the authentication credential, and if so, determining that the authentication credential is invalid, otherwise valid. In this implementation, the verification of the validity of the authentication credential is implemented through a proxy plug-in, which can ensure the validity of the authentication credential to a certain extent and further reduce the processing pressure of the proxy server.
[0009] In an optional implementation, after the proxy service is enabled for the browser, the method further includes: periodically obtaining the authentication credentials from the cookie information list and verifying the validity of the authentication credentials; if the authentication credentials are determined to be invalid, the proxy service is closed, a login authentication prompt is displayed to the user through the browser, and after the login authentication is completed, the step of obtaining the authentication credentials is returned. In this implementation, by periodically obtaining the authentication credentials, on the one hand, the changes in the user status can be obtained in a timely manner, and on the other hand, the latest authentication credentials can be obtained in a timely manner.
[0010] In a second aspect, an embodiment of the present invention provides a request proxy method, which is applied to a proxy server, and the method includes: receiving a tunnel establishment request sent by a browser, wherein the tunnel establishment request is used to instruct the proxy server to establish a connection with a source server; verifying the legality of the tunnel establishment request; if the tunnel establishment request is illegal, sending an authentication requirement message to the browser to instruct the browser to carry a valid authentication credential in the tunnel establishment request, wherein the authentication credential is provided to the browser by a proxy plug-in on the browser; if the tunnel establishment request is legal, establishing a connection with the source server.
[0011] In the request proxy method provided by the embodiment of the present invention, the proxy server receives the tunnel establishment request sent by the browser, the tunnel establishment request is used to instruct the proxy server to establish a connection with the source server requested by the browser to access, the proxy server verifies the legitimacy of the tunnel establishment request, if the tunnel establishment request is not legal, the proxy server sends an authentication requirement message to the browser to instruct the browser to carry a valid authentication credential in the tunnel establishment request, the authentication credential is provided to the browser by a proxy plug-in installed and loaded on the browser, if the tunnel establishment request is legal, the proxy server establishes a connection with the source server to proxy the access request to the source server issued by the browser, compared with the prior art, the proxy server of the present invention verifies the legitimacy of the tunnel establishment request by verifying the validity of the authentication credential carried in the tunnel establishment request, and only when the legitimacy verification of the tunnel establishment request is passed, will it establish a connection with the source server, so as to realize the legitimacy verification of the user through the proxy server, thereby improving the security of the access proxy, and avoiding the establishment of unnecessary connections with the source server, saving service resources. Furthermore, since the authentication credential carried in the tunnel establishment request is automatically provided by the proxy plug-in, the browser configuration process is reduced, and the security of user information is guaranteed.
[0012] In a preferred implementation manner, the verifying the legitimacy of the tunnel establishment request specifically includes:
[0013] It is detected whether the tunnel establishment request carries a valid authentication credential. If so, it is determined that the tunnel establishment request is legal; if not, it is determined that the tunnel establishment request is illegal.
[0014] In a preferred implementation, it is detected whether the tunnel establishment request carries a valid authentication credential, specifically including: if the tunnel establishment request carries an authentication credential, and the authentication credential is an authentication credential provided by the proxy server to the browser and has not expired, then it is determined that the tunnel establishment request carries a valid authentication credential.
[0015] In a preferred implementation, detecting whether the tunnel establishment request carries valid authentication credentials specifically includes: determining whether the tunnel establishment request meets the authority requirements based on the authentication credentials carried in the tunnel establishment request; if so, determining that the tunnel establishment request is legal; if not, feeding back a prompt message indicating that there is no authority to access to the browser.
[0016] In an optional implementation, the method further includes: receiving a login request sent by the browser, the login request carrying user authentication information; generating a corresponding authentication credential based on the user authentication information, and saving a mapping relationship between the authentication credential and the access rights corresponding to the user authentication information; responding to the login request, and carrying the authentication credential in the response information.
[0017] In a third aspect, an embodiment of the present invention provides a client device, on which a browser is running, and a proxy plug-in is loaded in the browser, wherein the proxy plug-in is used to implement the request proxy method described in the present invention.
[0018] In a fourth aspect, an embodiment of the present invention provides a proxy service device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the request proxy method described in the present invention when executing the program.
[0019] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0021] Figure 1 A schematic diagram of an application scenario of the request proxy method provided by an embodiment of the present invention;
[0022] Figure 2 A schematic diagram of an implementation flow of a request proxy method provided by an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of an implementation flow of a request proxy method provided by an embodiment of the present invention;
[0024] Figure 4A schematic diagram of an implementation flow of a request proxy method provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to solve the problem in the background technology, the embodiment of the present invention provides a request proxy method, a client device and a proxy service device.
[0026] The preferred embodiments of the present invention are described below in conjunction with the drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention. In addition, the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.
[0027] First reference Figure 1 , which is a schematic diagram of an application scenario of a request proxy method provided by an embodiment of the present invention. A browser is running on the client 11. When the user 10 needs to request a proxy service through the browser running on the client 11, a proxy plug-in can be installed on the browser running on the client 11. After the installation and loading of the proxy plug-in are completed, the proxy plug-in can obtain the authentication credential authorized by the proxy server 12 from the cookie information list cached by the browser, and verify the validity of the obtained authentication credential. If it is determined that the authentication credential is valid, the proxy service is enabled for the browser. If it is determined that the authentication credential is invalid, the proxy plug-in displays a login authentication prompt to the user through the browser, and after the login authentication is completed, the authentication credential authorized by the proxy server 12 is obtained from the cookie information list cached by the browser again for providing to the browser. In one implementation, the proxy plug-in can also periodically obtain the authentication credential from the cookie information list cached by the browser and verify its validity. When it is determined that the authentication credential is invalid, the enabled proxy service can be closed, and the login authentication prompt can be displayed to the user through the browser. Based on this, the proxy plug-in can periodically check the validity of the authentication credential, thereby ensuring the validity of the authentication credential provided to the browser.
[0028] Before the browser needs to send a service access request to the source server 13, it can first send a tunnel establishment request to request the establishment of a secure transmission tunnel for transmitting subsequent service access requests, wherein the tunnel establishment request is used to request the establishment of a TCP (Transmission Control Protocol) proxy tunnel.
[0029] Since the proxy function of the browser is enabled by the proxy plug-in, the tunnel establishment request will be forwarded to the proxy server 12. After receiving the tunnel establishment request sent by the browser, the proxy server 12 can verify the legitimacy of the tunnel establishment request. If the tunnel establishment request is legitimate, the proxy server 12 will respond to the tunnel establishment request after establishing a tunnel connection with the source server 13 to complete the tunnel connection with the client, thereby completing the establishment of the tunnel between the client and the proxy server, and the proxy server and the source server; if it is determined that the tunnel establishment request is not legitimate, the proxy server 12 will send an authentication requirement message to the browser to instruct the browser to carry a valid authentication credential in the tunnel establishment request. After receiving the authentication requirement message, the browser can obtain the authentication credential from the proxy plug-in and resend the tunnel establishment request, while carrying the obtained authentication credential in the tunnel establishment request.
[0030] In implementation, the method for the proxy server 12 to verify whether the tunnel establishment request is legal includes detecting whether the tunnel establishment request carries a valid authentication credential. If so, the tunnel establishment request is determined to be legal; if not, the tunnel establishment request is determined to be illegal. Specifically, when determining whether the authentication credential is valid, a judgment can be made by determining whether the authentication credential is provided by the proxy server to the browser and whether the authentication credential is expired.
[0031] In this application scenario, the client 11 and the proxy server 12 are communicated and connected via a network, and the proxy server 12 and the source station server 13 are communicated and connected via a network, which may be a local area network, a wide area network, etc. Preferably, the proxy server 12 and the source station server 13 may be communicated and connected based on a VPN network, wherein the VPN network may be implemented based on SD-WAN (Software-Defined Wide Area Network) technology.
[0032] The client 11 may be a terminal device with a browser installed (e.g., a smart phone, a tablet, a laptop, a personal computer (PC), etc.). The proxy server 12 may be any server that can provide proxy services, a server cluster consisting of several servers, or a cloud computing center, and the source server may be an application server deployed in a local area network.
[0033] Based on the above application scenarios, the following will refer to the attached Figure 2 to Figure 4 Describing the exemplary embodiments of the present invention in more detail, it is understood that the above application scenarios are only shown to facilitate understanding of the spirit and principle of the present invention, and the embodiments of the present invention are not limited in any way. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.
[0034] like Figure 2 As shown, it is a schematic diagram of an implementation flow of a request proxy method provided by an embodiment of the present invention. The request proxy method, applied in the above application scenario, may include the following steps:
[0035] S21. After the browser completes loading of the proxy plug-in, the proxy plug-in obtains the authentication credential authorized by the proxy server from the cookie information list cached by the browser.
[0036] In specific implementation, when the proxy service is needed, a proxy plug-in can be installed on the browser running on the client. After the browser completes loading the proxy plug-in, the proxy plug-in can automatically query the authentication credentials that meet the preset conditions from the cookie information list cached locally in the browser.
[0037] Specifically, the authentication credential is generated by the proxy server after completing the user identity authentication and sent to the client. Specifically, it can be sent to the client browser in the form of a cookie setting item (set-cookie), so that the browser generates the corresponding cookie information based on the cookie setting item and caches it in the local cookie information list. Among them, when generating the authentication credential, the proxy server can calculate a uniquely identifiable specified length string according to a preset algorithm, for example, encrypting the user identity information based on an encryption algorithm, or calculating a specified length string generated based on the login request time, or calculating a specified length string generated based on a random algorithm, as part of the content value of the authentication credential, and can set the authentication credential according to a preset format. Specifically, the authentication credential can be the "name" and "value" in the cookie information, for example, the cookie name of the cookie information generated by the specified browser based on the cookie setting item is "slweb_id", and the cookie value is a uniquely identifiable 32-bit string generated based on a random algorithm, which can be in the following form:
[0038] slweb_id=db066cab0F729bf1695ddbf3ceb8ffc7
[0039] In the specific implementation process, the proxy plug-in can query the cookie value named "slweb_id" from the cookie information list as the authentication credential. When the query result is empty, it means that the valid authentication credential cannot be obtained.
[0040] S22. The proxy plug-in verifies the validity of the authentication credential.
[0041] In specific implementation, when the proxy server generates the cookie setting item, it can specify the validity period to indicate the validity period of the cookie information. Therefore, when the browser generates the corresponding cookie information based on the cookie setting item, it will record the corresponding validity period. In other words, the validity period of the authentication credential is saved in the cookie information list. When the proxy plug-in queries the authentication credential, it can further determine whether the authentication credential has expired based on the current system time and the validity period of the authentication credential. If it has expired, it is determined that the authentication credential is invalid, otherwise it is valid.
[0042] S23. If the proxy plug-in determines that the authentication credential is valid, the proxy service is enabled for the browser.
[0043] In a specific implementation, if the proxy plug-in determines that the authentication credential is valid, the proxy service is enabled for the browser so that the access request sent by the browser is forwarded to the proxy server.
[0044] S24. If the proxy plug-in determines that the authentication credential is invalid, it displays a login authentication prompt to the user through the browser.
[0045] In specific implementation, if the proxy plug-in determines that the authentication credentials are invalid, it means that the user authentication is invalid. For example, if the user has not logged in for authentication, or the authentication has expired, he needs to log in again for authentication. At this time, the proxy plug-in can display a login authentication prompt to the user through the browser, prompting the user to access the login authentication page provided by the proxy server for login authentication.
[0046] Specifically, the browser may display the login authentication entry indicated by the proxy plug-in icon, such as by changing the color of the plug-in icon to prompt the user that login authentication is required, and the user clicks the plug-in icon to enter the login authentication page provided by the proxy server, that is, the plug-in icon may be linked to the login authentication page. A login reminder notification may also be sent to the user, and the user directly enters the URL (Uniform Resource Locator) address of the login authentication page on the browser to enter the login authentication page and enter the user authentication information, i.e., the user name and password. This is not limited in the embodiments of the present invention.
[0047] S25. The browser receives the user authentication information input by the user, and sends a login request carrying the user authentication information to the proxy server.
[0048] In specific implementation, the browser receives the user name and password input by the user, carries the user name and password in a login request and sends it to the proxy server, which performs authentication.
[0049] S26. The proxy server generates a corresponding authentication credential based on the user authentication information, and saves a mapping relationship between the authentication credential and the access authority corresponding to the user authentication information.
[0050] In specific implementation, the proxy server may first authenticate the user identity based on the user authentication information. When the authentication is passed, a corresponding authentication credential may be generated for this login. The process of generating the authentication credential has been described in step S21 and will not be repeated here. Furthermore, in order to facilitate the subsequent verification of the tunnel establishment request sent by the browser and provide the user authentication information to the source server, the proxy server may save the mapping relationship between the authentication credential and the user authentication information for subsequent query and verification. Furthermore, the proxy server may be pre-configured with access rights for each user, so that the user's access rights may be determined based on the user authentication information, and the access rights may be saved in the mapping relationship. The access rights are used to determine the source server information that the user can access.
[0051] S27. The proxy server responds to the login request and carries the authentication credentials in the response information, and returns the response message to the browser.
[0052] S28. The browser caches the authentication credentials into a cookie information list, and the proxy plug-in returns to execute the step of obtaining the authentication credentials in step S21.
[0053] S29. The browser sends a tunnel establishment request to the proxy server.
[0054] In a specific implementation process, the browser may send a tunnel establishment request via HTTPS (Hyper Text Transfer Protocol over Secure Socket Layer) or HTTP (HyperText Transfer Protocol) to request data interaction with the source server through the tunnel.
[0055] S210. The proxy server verifies the legitimacy of the tunnel establishment request. If it is legitimate, execute step S211; if it is not legitimate, execute step S213.
[0056] In specific implementation, the proxy server verifies the legitimacy of the tunnel establishment request in the following manner: the proxy server detects whether the tunnel establishment request carries valid authentication credentials. If so, the tunnel establishment request is determined to be legal; if not, the tunnel establishment request is determined to be illegal.
[0057] Specifically, the proxy server detects whether the tunnel establishment request carries a valid authentication credential in the following manner: if the tunnel establishment request carries an authentication credential, and the authentication credential is an authentication credential provided by the proxy server to the browser and has not expired, then it is determined that the tunnel establishment request carries a valid authentication credential. In implementation, after obtaining the authentication credential carried in the tunnel establishment request, the proxy server can query a locally stored mapping relationship based on the authentication credential to determine whether the authentication credential is generated by the proxy server.
[0058] In a preferred implementation, if the tunnel establishment request carries an authentication credential, and the authentication credential is an authentication credential provided by the proxy server to the browser and has not expired, it is further possible to determine whether the tunnel establishment request meets the authority requirements based on the authentication credential. If so, the tunnel establishment request is determined to be legal; if not, a prompt message indicating that there is no authority to access is fed back to the browser.
[0059] Determining whether the tunnel establishment request meets the authority requirement based on the authentication credential specifically includes:
[0060] The proxy server searches for the access rights corresponding to the authentication credentials carried in the tunnel establishment request according to the stored mapping relationship. If the access rights include the source server information of the user requesting the proxy server to establish a connection, it determines to proxy the tunnel establishment request. Otherwise, it determines that the tunnel establishment request does not need to be proxied and can be forwarded directly.
[0061] S211. The proxy server sends a connection establishment request to the source server and establishes a connection with the source server.
[0062] During specific implementation, the proxy server sends a connection establishment request to the source server to establish a TCP proxy tunnel connection with the source server.
[0063] S212: The source server establishes a TCP proxy tunnel connection with the proxy server.
[0064] S213. The proxy server sends an authentication requirement message to the browser to instruct the browser to carry a valid authentication credential in the tunnel establishment request.
[0065] In specific implementation, if the tunnel establishment request is illegal, the proxy server sends a 407 response code to the browser to instruct the browser to carry valid authentication credentials in the tunnel establishment request.
[0066] In a preferred implementation, in order to further ensure the validity of the authentication credentials, after the proxy service is turned on for the browser, the proxy plug-in can periodically obtain the authentication credentials authorized by the proxy server from the Cookie information list and verify the validity of the authentication credentials; if it is determined that the authentication credentials are invalid, the proxy service is turned off, and a login authentication prompt is displayed to the user through the browser, and after the login authentication is completed, the step of obtaining the authentication credentials (in step S21) is returned to execute. After the proxy service is turned off, the access request sent by the browser will no longer be forwarded to the proxy server, which can effectively reduce the processing pressure of the proxy server. Among them, the period for obtaining the authentication credentials can be set by oneself, and the examples of the present invention are not limited.
[0067] After receiving the authentication requirement message, the browser can obtain the authentication credential from the proxy plug-in, and regenerate a tunnel establishment request, and carry the authentication credential at the same time, and send it to the proxy server. In one implementation, the proxy plug-in is registered with an authentication callback function, and the authentication callback function is used to return the cookie information authorized after the proxy server authenticates the user authentication information (such as the unique user name and password set by the proxy server for the user) as the authentication credential. When the browser needs to obtain the authentication credential from the proxy plug-in, it can obtain the authentication credential by calling the authentication callback function.
[0068] It can be seen that compared with the prior art, the embodiment of the present invention verifies the legitimacy of the tunnel establishment request sent by the browser through the authentication credentials generated by the proxy server, which can ensure the security of network access to a certain extent. At the same time, by installing and loading the proxy plug-in on the browser, the proxy authentication and proxy functions are automatically implemented through the proxy plug-in. There is no need to pre-configure user authentication information on the browser (that is, the user name and password provided by the proxy server). Only login authentication is required. Login authentication requires the user to manually enter the user name and password, and there is no risk of leakage. After the authentication is successful, the proxy server generates the corresponding authentication credentials, and the authentication credentials are automatically obtained through the browser's proxy plug-in. The proxy function of the proxy plug-in automatically takes effect, thereby improving the security and service efficiency of the browser proxy service.
[0069] Based on the same inventive concept, an embodiment of the present invention also provides a request proxy method implemented on a proxy plug-in side. Since the principle of solving the problem by the request proxy method implemented on the proxy plug-in side is similar to that of the above-mentioned request proxy method, the implementation of the request proxy method implemented on the above-mentioned proxy plug-in side can refer to the implementation of the above-mentioned request proxy method, and the repeated parts will not be repeated.
[0070] like Figure 3 As shown, it is a schematic diagram of an implementation flow of a request proxy method provided by an embodiment of the present invention. The request proxy method, applied to a proxy plug-in, may include the following steps:
[0071] S31. After the browser completes loading of the proxy plug-in, the proxy plug-in obtains the authentication credential authorized by the proxy server from the cookie information list cached by the browser, and verifies the validity of the authentication credential.
[0072] Preferably, the obtaining of the authentication credentials authorized by the proxy server from the Cookie information list cached by the browser specifically includes:
[0073] Query the authentication credentials that meet the preset conditions from the Cookie information list.
[0074] Preferably, the validity period of the authentication credential is stored in the Cookie information list, and the verification of the validity of the authentication credential specifically includes:
[0075] Based on the current system time and the validity period of the authentication credential, it is determined whether the authentication credential has expired. If it has expired, the authentication credential is determined to be invalid; otherwise, it is valid.
[0076] S32: If the proxy plug-in determines that the authentication credential is valid, the proxy service is enabled for the browser so that the access request sent by the browser is received by the proxy server.
[0077] S33: If the proxy plug-in determines that the authentication credential is invalid, it displays a login authentication prompt to the user through the browser, and after the login authentication is completed, returns to execute the step of obtaining the authentication credential.
[0078] S34: When the browser needs to provide the authentication credential to the proxy server, the proxy plug-in provides the acquired valid authentication credential to the browser, so that the proxy server performs identity authentication based on the valid authentication credential.
[0079] Optionally, after enabling the proxy service for the browser, the method further includes:
[0080] Periodically obtaining the authentication credential from the Cookie information list and verifying the validity of the authentication credential;
[0081] If it is determined that the authentication credential is invalid, the proxy service is closed, a login authentication prompt is displayed to the user through the browser, and after the login authentication is completed, the step of obtaining the authentication credential is returned to be executed.
[0082] Based on the same inventive concept, an embodiment of the present invention also provides a request proxy method implemented on a proxy server side. Since the principle of solving the problem by the request proxy method implemented on the proxy server side is similar to that of the above-mentioned request proxy method, the implementation of the request proxy method implemented on the above-mentioned proxy server side can refer to the implementation of the above-mentioned request proxy method, and the repeated parts will not be repeated.
[0083] like Figure 4 As shown, it is a schematic diagram of an implementation flow of a request proxy method provided by an embodiment of the present invention. The request proxy method, applied to a proxy server, may include the following steps:
[0084] S41. The proxy server receives a tunnel establishment request sent by the browser, wherein the tunnel establishment request is used to instruct the proxy server to establish a connection with the source server.
[0085] S42: The proxy server verifies the legitimacy of the tunnel establishment request.
[0086] Preferably, the verifying the legitimacy of the tunnel establishment request specifically includes:
[0087] It is detected whether the tunnel establishment request carries a valid authentication credential. If so, it is determined that the tunnel establishment request is legal; if not, it is determined that the tunnel establishment request is illegal.
[0088] Preferably, detecting whether the tunnel establishment request carries a valid authentication credential specifically includes:
[0089] If the tunnel establishment request carries an authentication credential, and the authentication credential is an authentication credential provided by the proxy server to the browser and has not expired, it is determined that the tunnel establishment request carries a valid authentication credential.
[0090] Preferably, detecting whether the tunnel establishment request carries a valid authentication credential specifically includes:
[0091] Based on the authentication credentials carried in the tunnel establishment request, it is determined whether the tunnel establishment request meets the authority requirements. If so, it is determined that the tunnel establishment request is legal; if not, a prompt message indicating that there is no authority to access is fed back to the browser.
[0092] S43: If the tunnel establishment request is illegal, the proxy server sends an authentication requirement message to the browser to instruct the browser to carry a valid authentication credential in the tunnel establishment request.
[0093] The authentication credential is provided to the browser by a proxy plug-in on the browser.
[0094] S44: If the tunnel establishment request is legal, the proxy server establishes a connection with the source server.
[0095] Optionally, the method further comprises:
[0096] The proxy server receives the login request sent by the browser, wherein the login request carries user authentication information;
[0097] Generate a corresponding authentication credential based on the user authentication information, and save a mapping relationship between the authentication credential and the access rights corresponding to the user authentication information;
[0098] Respond to the login request and carry the authentication credential in the response information.
[0099] An embodiment of the present invention provides a client device, wherein a browser is running on the client device, and a proxy plug-in is loaded in the browser, wherein the proxy plug-in is used to implement the following Figure 3 The request proxy method shown.
[0100] An embodiment of the present invention provides a proxy service device, the proxy service device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, Figure 4 The request proxy method shown.
[0101] An embodiment of the present application also provides a computer-readable storage medium that stores computer-executable instructions required to execute the above-mentioned processor, which includes a program required to execute the above-mentioned processor.
[0102] In some possible implementations, various aspects of the request proxy method provided by the present invention may also be implemented in the form of a program product, which includes a program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the request proxy method according to various exemplary implementations of the present invention described above in this specification.
[0103] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0105] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0107] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0108] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A request proxy method, characterized in that: Applied to a proxy plug-in, the method comprises: When the browser completes loading of the proxy plug-in, the authentication credential authorized by the proxy server is obtained from the cookie information list cached by the browser, and the validity of the authentication credential is verified, wherein the authentication credential is generated by the proxy server after receiving the login request sent by the browser to complete the user identity authentication, and the authentication credential is carried in the response information to the login request and returned to the browser, and is cached by the browser in the cookie information list; If it is determined that the authentication credential is valid, enabling a proxy service for the browser so that the access request sent by the browser is received by the proxy server; If it is determined that the authentication credential is invalid, a login authentication prompt is displayed to the user through the browser, and after the login authentication is completed, the authentication credential authorized by the proxy server is obtained from the cookie information list cached by the browser; When the browser needs to provide the authentication credential to the proxy server, the acquired valid authentication credential is provided to the browser, so that the proxy server performs identity authentication based on the valid authentication credential.
2. The method according to claim 1, characterized in that The obtaining of the authentication credentials authorized by the proxy server from the Cookie information list cached by the browser specifically includes: Query the authentication credentials that meet the preset conditions from the Cookie information list.
3. The method according to claim 1, characterized in that The validity period of the authentication credential is stored in the Cookie information list, and the verification of the validity of the authentication credential specifically includes: Based on the current system time and the validity period of the authentication credential, it is determined whether the authentication credential has expired. If it has expired, the authentication credential is determined to be invalid; otherwise, it is valid.
4. The method according to claim 1, characterized in that After enabling the proxy service for the browser, the method further includes: Periodically obtaining the authentication credential from the Cookie information list and verifying the validity of the authentication credential; If it is determined that the authentication credential is invalid, the proxy service is closed, a login authentication prompt is displayed to the user through the browser, and after the login authentication is completed, the authentication credential authorized by the proxy server is obtained from the cookie information list cached by the browser.
5. A request proxy method, characterized in that: Applied to a proxy server, the method comprises: Receiving a tunnel establishment request sent by the browser, wherein the tunnel establishment request is used to instruct the proxy server to establish a connection with the source server; Verifying the legitimacy of the tunnel establishment request, specifically comprising: detecting whether the tunnel establishment request carries a valid authentication credential, if so, determining that the tunnel establishment request is legal; if not, determining that the tunnel establishment request is illegal; If the tunnel establishment request is illegal, sending an authentication requirement message to the browser to instruct the browser to carry a valid authentication credential in the tunnel establishment request, wherein the authentication credential is provided to the browser by a proxy plug-in on the browser, and the authentication credential is generated by the proxy server after completing user identity authentication; If the tunnel establishment request is legal, a connection is established with the source server.
6. The method according to claim 5, characterized in that Detecting whether the tunnel establishment request carries a valid authentication credential, specifically including: If the tunnel establishment request carries an authentication credential, and the authentication credential is an authentication credential provided by the proxy server to the browser and has not expired, it is determined that the tunnel establishment request carries a valid authentication credential.
7. The method according to claim 5 or 6, characterized in that Checking whether the tunnel establishment request carries a valid authentication credential includes: Based on the authentication credentials carried in the tunnel establishment request, it is determined whether the tunnel establishment request meets the authority requirements. If so, it is determined that the tunnel establishment request is legal; if not, a prompt message indicating that there is no authority to access is fed back to the browser.
8. The method according to claim 5, characterized in that The method further comprises: Receiving a login request sent by the browser, wherein the login request carries user authentication information; Generate a corresponding authentication credential based on the user authentication information, and save a mapping relationship between the authentication credential and the access rights corresponding to the user authentication information; Respond to the login request and carry the authentication credential in the response information.
9. A client device, characterized in that: A browser is running on the client device, and a proxy plug-in is loaded in the browser, wherein the proxy plug-in is used to implement the request proxy method according to any one of claims 1 to 4.
10. A proxy service device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the request proxy method according to any one of claims 5 to 8 when executing the program.
