Service access method and device, system, equipment, medium
By generating different access addresses based on the same domain name between the client and the reverse proxy server, the problem of high cost of multiple certificates is solved, and the effect of reducing certificate costs and operation and maintenance costs in the client-server architecture is achieved.
Patent Information
- Application Number
- CN202210460478.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-04-28
AI Technical Summary
In the client-server architecture, using https transmission method requires certificates issued by the CA organization, which leads to high certificate costs, especially when multiple certificates are required when multiple servers are needed, which increases configuration and operation and maintenance costs.
By generating different access addresses based on the same domain name between the client and the reverse proxy server, only one domain name can access the server that provides different services, thereby reducing the number of CA certificates and configuration operation and maintenance costs.
It realizes that only one domain name is needed when accessing multiple servers is required, which reduces the cost of CA certificates and operation and maintenance costs, and improves the maintenance efficiency and manageability of the system.
Smart Images

Figure CN114760349B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and in particular to a service access method and device, system, equipment and medium. Background Art
[0002] In the application scenarios of the client-server architecture, the https transmission method is often used. The https transmission method requires a certificate issued by a CA organization, and then accessed through a domain name. Some servers can provide at least two client-server-based services, so at least two domain names are required for corresponding access, and therefore at least two certificates are required. However, CA certificates are issued by CA organizations, and each certificate requires a certain fee. The more certificates required, the higher the cost. Summary of the invention
[0003] The present invention provides a service access method and device, system, equipment and medium, which can reduce the required CA certificates and lower the cost.
[0004] In a first aspect, an embodiment of the present invention provides a service access method, the method being executed by a client, the method comprising:
[0005] Upon receiving a first access request from a user to an application system, determining whether the user has been authenticated; wherein the first access request is a request to access any page in the application system;
[0006] If the user authentication has not been performed or the authentication has failed, obtaining the domain name in the first access request;
[0007] Generate a second access address according to the domain name; wherein the second access address is different from the first access address in the first access request;
[0008] Generate a second access request including the second access address, and send the second access request to the reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client.
[0009] In a second aspect, an embodiment of the present invention provides a service access method, the method being executed by a reverse proxy server, the method comprising:
[0010] Determining that the access request sent by the client is a second access request;
[0011] According to the second access address in the parsed second access request, the second access request is sent to the authentication server of the application system, so that the authentication server provides user authentication service to the client;
[0012] The second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the first access request is an access request for any page in the application system.
[0013] In a third aspect, an embodiment of the present invention provides a service access device, the device being a device on a client, the device comprising:
[0014] An authentication determination module, used to determine whether the user has been authenticated when receiving a first access request from the user to the application system; wherein the first access request is a request to access any page in the application system;
[0015] a domain name acquisition module, configured to acquire the domain name in the first access request if user authentication has not been performed or authentication has failed;
[0016] an address generation module, configured to generate a second access address according to the domain name; wherein the second access address is different from the first access address in the first access request;
[0017] A request generation module is used to generate a second access request including the second access address, and send the second access request to a reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client.
[0018] In a fourth aspect, an embodiment of the present invention provides a service access device, the device is a device on a reverse proxy server, and the device includes:
[0019] a request determination module, used to determine that the access request sent by the client is a second access request;
[0020] A request sending module is used to send the second access request to the authentication server of the application system according to the second access address in the parsed second access request, so that the authentication server provides user authentication service to the client; wherein the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the first access request is an access request for any page in the application system.
[0021] In a fifth aspect, an embodiment of the present invention provides a service access system, comprising at least one client and at least one reverse proxy server; wherein:
[0022] The at least one client is used to determine whether the user has been authenticated when receiving a first access request from the user to the application system; wherein the first access request is an access request to any page in the application system; if the user has not been authenticated or the authentication has not passed, then obtain the domain name in the first access request; generate a second access address based on the domain name; wherein the second access address is different from the first access address in the first access request; generate a second access request including the second access address, and send the second access request to the reverse proxy server;
[0023] The at least one reverse proxy server is used to: determine that the access request sent by the client is a second access request; and send the second access request to the authentication server of the application system according to the second access address in the parsed second access request, so that the authentication server provides user authentication services to the client; wherein the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the first access request is an access request for any page in the application system.
[0024] In a sixth aspect, an embodiment of the present invention provides a computing device, the device comprising: at least one memory and at least one processor;
[0025] The at least one memory is used to store a machine-readable program;
[0026] The at least one processor is used to call the machine-readable program to execute the method provided by the first aspect or the second aspect.
[0027] In a seventh aspect, an embodiment of the present invention provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect or the second aspect.
[0028] The service access method, apparatus, system, device, and medium provided in the embodiment of the present invention, upon receiving the first access request from the user to the application system, determines whether the user has been authenticated; if the user has not been authenticated or the authentication has not passed, obtains the domain name in the first access request; generates a second access address based on the domain name; generates a second access request including the second access address, and sends the second access request to the reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system based on the second access address, so that the authentication server provides user authentication services to the client. Since the second access address in the second access request in the embodiment of the present invention is also based on the domain name in the first access request, that is, two different access addresses are generated based on the same domain name, that is, when it is necessary to access two servers providing different services, only one domain name is needed, and there is no need to apply for two domain names, which can reduce the cost of CA certificates and also reduce the configuration and operation and maintenance costs of CA certificates. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] 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 will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 is a system architecture diagram applicable to a service access method in one embodiment of the present invention;
[0031] Figure 2 is a flow chart of a service access method in one embodiment of the present invention;
[0032] Figure 3 is a flow chart of a service access method in another embodiment of the present invention;
[0033] Figure 4 is a structural block diagram of a service access device in one embodiment of the present invention;
[0034] Figure 5 It is a structural block diagram of a service access device in another embodiment of the present invention.
[0035] Description of reference numerals:
[0036] 10 Client 20 Reverse Proxy Server 30 Authentication Server 40 Front-end server S110~S140 step S210~S220 step 100 Service access device on the client 110 Authentication Determination Module 120 Domain name acquisition module 130 Address generation module 140 Request generation module 200 Service access device on reverse proxy server 210 Request confirmation module 220 Request sending module DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0038] In order to facilitate the understanding of the method provided in this specification, the system architecture involved and applicable to this specification is first described. Figure 1 As shown in , the system architecture mainly includes four network nodes: a client 10 , a reverse proxy server 20 , an authentication server 30 and a front-end server 40 .
[0039] Among them, the client 10 is installed and runs in the terminal device, and the terminal device may include but is not limited to: intelligent mobile terminal, PC (personal computer), etc. Among them, intelligent mobile devices may include such as mobile phones, tablet computers, laptops, PDAs (personal digital assistants), etc. The client can be a web version of the client, for example, a browser, or an app. The solution provided in the embodiment of the present invention is particularly suitable for the web version of the client. The user can access the authentication server and the front-end server through the client, so that the authentication server provides corresponding authentication services, and the front-end server provides corresponding front-end business services. The client corresponds to the application system below, that is, the client is the client of the application system.
[0040] Among them, the role of the reverse proxy server 20 is to distinguish different access requests, and then forward different access requests to different servers, such as an authentication server and a front-end server. The reverse proxy server can be a single server or a server group consisting of multiple servers. In addition to distinguishing and forwarding access requests, the reverse proxy server can also determine whether the access request meets the preset requirements, for example, whether the access request is an http request or an https request. If it is an http request, the http request needs to be rewritten as an https request, and then forwarded after rewriting to increase the security of data transmission.
[0041] The role of the authentication server 30 is to provide user authentication services. The so-called user authentication is to verify the identity of the user. Only users who pass the user authentication can access the data in the application system. Of course, different users can also have different permissions. For example, some users have higher permissions, so the user can perform more operations in the application system, while some users have lower permissions, so the user can perform fewer operations in the application system.
[0042] The front-end server 40 provides services such as data display and operation. Users can perform various operations on the client of the application system, and the client can provide corresponding feedback on the page according to the user's operation. This is all achieved by the front-end server.
[0043] It is understandable that the authentication server and the front-end server can be a single server or a server group composed of multiple servers. Moreover, the authentication server and the front-end server are servers that provide two different services in the application system.
[0044] In a first aspect, based on the above system architecture, an embodiment of the present invention provides a service access method, which is executed by a client, for example, by a browser. Figure 2 The service access method provided in this embodiment includes the following steps S110 to S140:
[0045] S110, upon receiving a first access request from a user to an application system, determining whether the user has been authenticated; wherein the first access request is a request to access any page in the application system;
[0046] For example, a user enters the domain name of a website to be accessed on a browser, which generates the user's first access request to the main page of the website. At this time, the browser will determine whether the user has been authenticated. If the user has not been authenticated, the browser page will jump to the authentication page, that is, the browser redirects to the authentication page to allow the user to enter relevant authentication information. If it is determined that the user has been authenticated, no further authentication is required, and the main page of the website the user wants to access is directly displayed on the browser.
[0047] It is understandable that a website will have many pages, and users can browse different information and perform different operations on different pages. Users can enter the domain name of the website to access the main page of the website, or enter the address of a page on the website to access the page. Among them, the address of any page on the website includes the domain name of the website.
[0048] Among them, the above-mentioned first access request can be an access request to any page of the application system. The application system can be but is not limited to the Siemens Predictive Analysis system, referred to as the SiePA system, which is the Siemens predictive operation and maintenance system in Chinese. The system is based on industrial artificial intelligence technology and Siemens' industry knowledge accumulated through deep industrial development. Through the prediction and early warning module and the intelligent troubleshooting and diagnosis module, it judges the equipment operation risks, fault diagnosis and maintenance strategies, and gives recommended solutions. It can be understood that the system provides an analysis template for customers. Customers map the actual status of the factory and industry knowledge into the analysis template to solidify it into a model, and then apply it to specific business scenarios. At the same time, the system can also be continuously upgraded and iterated with new needs to achieve full life cycle management of artificial intelligence models and form a continuous closed loop.
[0049] Furthermore, the SiePA system has two independent application services: authentication service keycloak and front-end business service pd-angular2. The authentication service keycloak can provide authentication services for users, and of course, authorization services. The authentication service keycloak is implemented based on the Oauth2 protocol. The front-end business service pd-angular2 can provide users with services such as display and operation of various data on the browser, that is, front-end business services.
[0050] For the authentication service keycloak, when a user accesses the SiePA system, the system must first perform some authentication on the user (for example, user name, password, etc.), and only after the authentication is passed can the user enter the system. After logging in, the user's personal information and system data will be displayed. If others do not know a user's user name and password, then others cannot see the user's personal information and corresponding system data. In addition, the SiePA system is divided into multiple permissions. Users with different permissions can see different data and perform different page operations (view, modify, delete, etc.). This service is called authorization. In addition to providing authentication services, the authentication service keycloak can also provide authorization services.
[0051] For front-end business services, pd-angular2 is a front-end display service based on angular technology or typescript technology. Typescript technology is integrated into angular technology. Since the SiePA system is ultimately presented as a web application on the client device, the SiePA system can be accessed through a specific URL, and various data and operations on the page (for example, clicking a button with the mouse) are displayed on the page. The display of data and the operation of the page are all achieved through angular technology.
[0052] At present, the http protocol is generally used for data transmission between browsers and World Wide Web servers. The http protocol is Hyper Text Transfer Protocol, which is called Hypertext Transfer Protocol in Chinese. The http protocol works on the client-server architecture. As an http client, the browser sends all requests to the http server, i.e., the WEB server, through the URL. After receiving the request, the Web server sends a response message to the client. Although the http protocol is widely used, it has significant security flaws, mainly because its data is transmitted in plain text and lacks message integrity detection. These two points happen to be the most important security issues in emerging applications such as online payment and online transactions. The https protocol is a network protocol that can perform encrypted transmission and identity authentication by combining http with the TLS / SSL protocol. It mainly uses digital certificates, encryption algorithms, asymmetric keys and other technologies to complete Internet data transmission encryption and realize Internet transmission security protection. The SiePA system initially used http for data transmission, and later changed to httpS to ensure the security of data transmission. The https method requires a certificate issued by a digital certificate authority (i.e., CA institution) and then accessed through a domain name. Since the SiePA system provides two services, angular and keycloak, both services can be accessed through the front-end browser, which requires two domain names. The two domain names require two CA certificates. Each CA certificate costs a certain amount of money, and professional personnel are required to perform relevant configuration when using the CA certificate. Therefore, the more digital certificates there are, the higher the certificate payment fee and the higher the operation and maintenance cost.
[0053] Therefore, the application system targeted by the method provided in the embodiment of the present invention is a system that can at least provide authentication services and front-end business services, and currently different services require different CA certificates.
[0054] In a specific implementation, the process of determining whether the user has been authenticated in S110 may include: searching for log information within a preset time period before receiving the first access request, and judging whether the user authentication operation has been performed and whether the authentication has been passed through the log information. The preset time period may be, for example, within 5 minutes before receiving the first access request.
[0055] That is to say, the determination of whether the user has been authenticated in S110 may include: obtaining client operation log information within a preset time period before the moment of receiving the first access request; determining whether the user has been authenticated based on the client operation log information; and determining whether the authentication is successful if the user has been authenticated.
[0056] S120: If the user authentication has not been performed or the authentication has not passed, obtaining the domain name in the first access request;
[0057] It is understandable that if it is determined that the user has not been authenticated, then user authentication is required. Therefore, the domain name in the first access request is obtained in S120.
[0058] The first access request includes the address of the page to be accessed, which is called the first access address, and includes the domain name of the application system. For example, the first access address in the first access request for the home page of an application system is: https: / / domainNameA, where domainNameA is the domain name of the application system.
[0059] The authentication service and front-end business service of the application system can be provided by the same server device or by different server devices, and can also be provided by the same or different server clusters. That is, the authentication server is a server that provides authentication services, and the front-end server is a server that provides front-end business services. The authentication server and the front-end server can be the same server or different servers, and can also be the same server cluster or different server clusters.
[0060] S130. Generate a second access address according to the domain name; wherein the second access address is different from the first access address in the first access request;
[0061] In S130, a second access address is generated according to the domain name in the first access address of the first access request. Since user authentication is required at this time, the second access address is the address of the authentication server. The second access address is different from the first access address mentioned above, but since the second access address is also generated based on the domain name, that is, the second access address and the first access address are two different addresses generated based on the same domain name.
[0062] It can be seen that since two different access addresses are generated based on the same domain name in the embodiment of the present invention, when two servers providing different services need to be accessed, only one domain name is needed, and there is no need to apply for two domain names. This can reduce the cost of CA certificates and also reduce the configuration and operation and maintenance costs of CA certificates.
[0063] In a specific implementation, S130 may specifically include: generating a second access address including the domain name and the preset tag according to the domain name and the preset tag; wherein the preset tag is used to enable the reverse proxy server to distinguish the received access request according to the preset tag.
[0064] That is to say, in addition to the domain name of the application system, the second access address also includes a preset tag. The preset tag can be saved in the reverse proxy server, so that when the reverse proxy server receives the access request, it can determine whether the access request is the first access request or the second access request by whether the access address contains the preset tag. Specifically, if the access address of the access request contains the preset tag, it means that the access request is the second access request, and the access address in the access request is the second access address. At this time, the reverse proxy server will send the second access request to the authentication server. If the access address of the access request does not include the preset tag, it means that the access request is the first access request, and the access address in the access request is the first access address. At this time, the reverse proxy server will send the first access request to the front-end server. It can be seen that the reverse proxy server will perform different routing forwarding according to whether the access request contains the preset tag.
[0065] Furthermore, the position of the preset mark in the access address and the specific preset mark to be used may also be specified. For example, the preset mark may include a preset character string that is set after the domain name and adjacent to the domain name.
[0066] For example, after receiving the first access request with the first access address https: / / domainNameA / XX, it can be known that the user wants to access a page in the application system with the domain name domainNameA. Since it is determined that the user has not been authenticated, the second access address generated at this time can be https: / / domainNameA / auth, and then the second access request is generated based on the second access address and sent to the reverse proxy server. When the reverse proxy server receives the second access request, it is found through analysis that there is a preset string auth after the domain name domainNameA and adjacent to the domain name, and the second access request is directly sent to the authentication server. Among them, https: / / domainNameA is the main page of the application system, and https: / / domainNameA / XX is a page in the application system.
[0067] S140. Generate a second access request including the second access address, and send the second access request to the reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client.
[0068] It is understandable that in S140, a second access request is generated based on the second access address generated in S130, and then the second access request is sent to the reverse proxy server, so that the reverse proxy server will send the second access request to the authentication server, and the authentication server will provide user authentication service, that is, redirect the browser to the authentication page, so that the user can enter authentication information on the authentication page, thereby realizing the identity authentication of the user.
[0069] In the prior art, in addition to using at least two CA certificates, no reverse proxy server is set between the browser and the server providing services in the background, that is, the functions of the reverse proxy server and the server providing services in the background are mixed together, the division of labor is unclear, maintenance is difficult, and it is difficult to locate when problems occur.
[0070] However, in the embodiment of the present invention, the functions of the reverse proxy server and the server providing services in the background are separated, and the reverse proxy server is used to distinguish different access requests, and then forward different access requests to different servers. This has the advantages of clear division of labor, easy maintenance, and easy location when problems occur.
[0071] In a specific implementation, the method provided by the embodiment of the present invention may further include:
[0072] If user authentication has been performed and passed, the first access request is sent to the reverse proxy server, so that the reverse proxy server sends the first access request to the front-end server of the application system according to the first access address, so that the front-end server provides front-end business services to the client.
[0073] That is to say, if the user has been authenticated, the browser does not need to redirect. The browser directly sends the first access request to the reverse proxy server. After judgment, the reverse proxy server finds that the first access address of the first access request does not contain a preset tag. At this time, the reverse proxy server will directly send the first access request to the front-end server.
[0074] It is understandable that in the prior art, if you want to access two different services through a domain name, you need to configure two domain names and ports, and then you need two sets of digital certificates to achieve this. In the embodiment of the present invention, only one domain name and port are needed to achieve access to two different services, that is, one set of digital certificates is needed. That is, the embodiment of the present invention can achieve access to two services through one domain name.
[0075] It is understandable that the client in the embodiment of the present invention is not limited to the above-mentioned browser, but can also be an app, that is, the client in the embodiment of the present invention is a client in various forms.
[0076] The service access method provided in the embodiment of the present invention determines whether the user has been authenticated when receiving the first access request from the user to the application system; if the user has not been authenticated or the authentication has not passed, the domain name in the first access request is obtained; a second access address is generated according to the domain name; a second access request including the second access address is generated, and the second access request is sent to the reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client. Since the second access address in the second access request in the embodiment of the present invention is also based on the domain name in the first access request, that is, two different access addresses are generated based on the same domain name, that is, when it is necessary to access two servers providing different services, only one domain name is needed, and there is no need to apply for two domain names, which can reduce the cost of CA certificates and also reduce the configuration and operation and maintenance costs of CA certificates.
[0077] In a second aspect, an embodiment of the present invention provides a service access method, see Figure 3 The method is executed by a reverse proxy server, and the method includes the following steps S210 to S220:
[0078] S210, determining that the access request sent by the client is a second access request;
[0079] S220: sending the second access request to the authentication server of the application system according to the second access address in the parsed second access request, so that the authentication server provides user authentication service to the client;
[0080] The second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the first access request is an access request for any page in the application system.
[0081] For example, after receiving an access request sent by a web client, it is determined that the received access request is a second access request. At this time, the second access request is sent to the authentication server. When the authentication server receives the second access request, it will provide feedback, thereby redirecting the web client to the authentication page.
[0082] Further, in S210, the reverse proxy server determines that the access request sent by the client is the second access request, which may specifically include: if the access address in the access request includes a preset tag, the access request is the second access request.
[0083] That is, a preset tag is pre-stored in the reverse proxy server. When the reverse proxy server receives an access request, it can determine whether the access address of the access request contains the preset tag, thereby distinguishing the first access request from the second access request.
[0084] In specific implementation, the preset mark may be further limited to prevent incorrect distinction. For example, the preset mark is specified to be located after the domain name in the second access address and to be a preset character string.
[0085] Of course, in the case where the received access request is the first access request, the above method may further include: when it is determined that the access request sent by the client is the first access request, sending the first access request to the front-end server of the application system according to the first access address in the first access request, so that the front-end server provides front-end business services to the client.
[0086] That is to say, if the first access request is received, the first access request is sent to the front-end server, so that the front-end server provides corresponding front-end business services when receiving the first access request.
[0087] In a specific implementation, the reverse proxy server may further determine whether the access request is an Http request before sending the second access request to the authentication server of the application system; if so, the access request is rewritten into an https request.
[0088] That is to say, before sending the second access request to the authentication server, it is determined whether the second access request is an http request. If it is an http request, the second access request is rewritten as an https request, which can improve the security of data transmission.
[0089] In fact, the above judgment and processing are performed not only on the second access request, but also on the first access request. That is, before sending the access request to the corresponding server, the reverse proxy server needs to determine whether the access request is an http request. If so, it is rewritten as an https request, and then the rewritten request is sent to the corresponding server.
[0090] For example, in order to realize the function of distinguishing different access requests and forwarding them, the reverse proxy server can be configured on the reverse proxy server. For example, the address of the authentication server is configured in the reverse proxy server, for example, the address of the authentication server is set to https: / / service-iam-keycloak:8080 / auth, that is, if the second access request is received, the reverse proxy server will forward the second access request to the authentication server corresponding to the address. In addition, all IP address sets of the client are configured, so that the reverse proxy server only accepts access requests sent by clients with IP addresses in the set. Information such as port and cache size can also be configured. For another example, the address of the front-end server is configured, for example, the address of the front-end server is configured to https: / / pd-angular2:80. If the reverse proxy server finds that there is no preset tag in the access request, the access request is sent to the address of the front-end server. The supported http version is also configured, such as supporting http1.1. The technology for the server to push information to the client can also be configured, for example, it can be configured to use websocket technology.
[0091] It is understandable that in the method provided in this embodiment, the reverse proxy server and the background server are separated, and the reverse proxy server distinguishes whether the received access request is the first access request or the second access request, and then performs different routing forwarding according to different requests, thereby forwarding different access requests to different servers. This has the advantages of clear division of labor, easy maintenance, and easy location when problems occur.
[0092] In a third aspect, an embodiment of the present invention provides a service access device, which is a device on a client, and corresponds to the method provided in the first aspect. Figure 4 , the device 100 comprises:
[0093] An authentication determination module 110, configured to determine whether the user has been authenticated upon receiving a first access request from the user to the application system; wherein the first access request is a request to access any page in the application system;
[0094] A domain name acquisition module 120, configured to acquire the domain name in the first access request if user authentication has not been performed or authentication has failed;
[0095] an address generation module 130, configured to generate a second access address according to the domain name; wherein the second access address is different from the first access address in the first access request;
[0096] A request generation module 140 is used to generate a second access request including the second access address, and send the second access request to the reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client.
[0097] In some embodiments, the address generation module is specifically used to: generate a second access address including the domain name and the preset tag according to the domain name and the preset tag; wherein the preset tag is used to enable the reverse proxy server to distinguish the received access request according to the preset tag.
[0098] Furthermore, the preset mark includes a preset character string that is set after the domain name and adjacent to the domain name.
[0099] In some embodiments, the authentication determination module is specifically used to: obtain client operation log information within a preset time period before the moment of receiving the first access request; determine whether the user has been authenticated based on the client operation log information; if authenticated, determine whether the authentication is successful.
[0100] In some embodiments, the apparatus may further include:
[0101] A first sending module is used to: if user authentication has been performed and passed, send the first access request to the reverse proxy server, so that the reverse proxy server sends the first access request to the front-end server of the application system according to the first access address, so that the front-end server provides front-end business services to the client.
[0102] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.
[0103] In a fourth aspect, an embodiment of the present invention provides a service access device, which is a device on a reverse proxy server, and the device corresponds to the method provided in the second aspect, see Figure 5 , the device 200 comprises:
[0104] a request determination module 210, configured to determine that the access request sent by the client is a second access request;
[0105] A request sending module 220 is used to send the second access request to the authentication server of the application system according to the second access address in the parsed second access request, so that the authentication server provides user authentication services to the client; wherein the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the first access request is an access request for any page in the application system.
[0106] In some embodiments, the request determination module is specifically configured to: if the access address in the access request includes a preset tag, then the access request is the second access request.
[0107] In some embodiments, the apparatus further comprises:
[0108] A second sending module is used to send the first access request to the front-end server of the application system according to the first access address in the first access request when it is determined that the access request sent by the client is a first access request, so that the front-end server provides front-end business services to the client.
[0109] In some embodiments, the apparatus further comprises:
[0110] A request judgment module is used to judge whether the access request is an Http request before the request sending module sends the second access request to the authentication server of the application system; if so, rewrite the access request into an https request.
[0111] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the second aspect, and will not be repeated here.
[0112] In a fifth aspect, an embodiment of the present invention provides an access service system, comprising at least one client and at least one reverse proxy server; wherein:
[0113] The at least one client is used to determine whether the user has been authenticated when receiving a first access request from the user to the application system; wherein the first access request is an access request to any page in the application system; if the user has not been authenticated or the authentication has not passed, then obtain the domain name in the first access request; generate a second access address based on the domain name; wherein the second access address is different from the first access address in the first access request; generate a second access request including the second access address, and send the second access request to the reverse proxy server;
[0114] The at least one reverse proxy server is used to: determine that the access request sent by the client is a second access request; and send the second access request to the authentication server of the application system according to the second access address in the parsed second access request, so that the authentication server provides user authentication services to the client; wherein the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the first access request is an access request for any page in the application system.
[0115] It is understandable that the explanation of the relevant contents, specific implementation methods, beneficial effects, examples, etc. of the system provided in the embodiment of the present invention can be found in the corresponding parts of the methods provided in the first and second aspects, and will not be repeated here.
[0116] In a sixth aspect, an embodiment of the present invention provides a computing device, comprising: at least one memory and at least one processor; the at least one memory is used to store a machine-readable program; the at least one processor is used to call the machine-readable program to execute the method provided in the first aspect or the second aspect.
[0117] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided in the embodiment of the present invention can be referred to the corresponding parts of the method provided in the first aspect or the second aspect, and will not be repeated here.
[0118] In a seventh aspect, an embodiment of the present invention provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect or the second aspect.
[0119] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.
[0120] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0121] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0122] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0123] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0124] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiments of the present invention can be found in the corresponding parts of the methods provided in the first aspect or the second aspect, and will not be repeated here.
[0125] Each embodiment in this specification is described in a progressive 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 device 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.
[0126] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0127] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A service access method, characterized in that: The method is executed by a client, and includes: Upon receiving a first access request from a user to an application system, determining whether the user has been authenticated; wherein the first access request is a request to access any page in the application system; If user authentication has been performed and passed, the first access request is sent to the reverse proxy server, so that the reverse proxy server sends the first access request to the front-end server of the application system according to the first access address, so that the front-end server provides front-end business services to the client; If the user authentication has not been performed or the authentication has failed, obtaining the domain name in the first access request; Generate a second access address including the domain name according to the domain name; wherein the second access address is different from the first access address in the first access request; Generate a second access request including the second access address, and send the second access request to the reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client.
2. The method according to claim 1, characterized in that: Generating a second access address according to the domain name includes: According to the domain name and the preset mark, a second access address including the domain name and the preset mark is generated; wherein the preset mark is used to enable the reverse proxy server to distinguish the received access request according to the preset mark.
3. The method according to claim 2, characterized in that The preset mark includes a preset character string that is set after the domain name and adjacent to the domain name.
4. The method according to claim 1, characterized in that: The determining whether the user has been authenticated comprises: Acquire client operation log information within a preset time period before the moment of receiving the first access request; According to the client operation log information, determine whether the user has been authenticated; if authenticated, determine whether the authentication is successful.
5. A service access method, characterized in that: The method is performed by a reverse proxy server, and the method comprises: Determining that the access request sent by the client is a second access request; According to the second access address in the parsed second access request, the second access request is sent to the authentication server of the application system, so that the authentication server provides user authentication service to the client; When it is determined that the access request sent by the client is a first access request, sending the first access request to the front-end server of the application system according to the first access address in the first access request, so that the front-end server provides front-end business services to the client; Among them, the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, and the second access address includes the domain name; the first access request is an access request for any page in the application system.
6. The method according to claim 5, characterized in that The determining that the access request sent by the client is a second access request includes: If the access address in the access request includes a preset tag, the access request is the second access request.
7. The method according to claim 5, characterized in that Before sending the second access request to the authentication server of the application system, the method further includes: Determine whether the access request is an Http request; if so, rewrite the access request into an https request.
8. A service access device, characterized in that: The device (100) is a device on a client, and comprises: An authentication determination module (110) is used to determine whether the user has been authenticated when receiving a first access request from the user to the application system; wherein the first access request is a request to access any page in the application system; A domain name acquisition module (120), configured to acquire the domain name in the first access request if user authentication has not been performed or the authentication has not passed; An address generation module (130) is used to generate a second access address including the domain name according to the domain name; wherein the second access address is different from the first access address in the first access request; A request generation module (140) is used to generate a second access request including the second access address, and send the second access request to a reverse proxy server, so that the reverse proxy server sends the second access request to the authentication server of the application system according to the second access address, so that the authentication server provides user authentication services to the client; and if user authentication has been performed and passed, send the first access request to the reverse proxy server, so that the reverse proxy server sends the first access request to the front-end server of the application system according to the first access address, so that the front-end server provides front-end business services to the client.
9. A service access device, characterized in that: The device (200) is a device on a reverse proxy server, and comprises: a request determination module (210), configured to determine that the access request sent by the client is a second access request; A request sending module (220) is used to send the second access request to the authentication server of the application system according to the second access address in the second access request parsed, so that the authentication server provides user authentication services to the client; when it is determined that the access request sent by the client is a first access request, send the first access request to the front-end server of the application system according to the first access address in the first access request, so that the front-end server provides front-end business services to the client; wherein the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, the second access address includes the domain name, and the first access request is an access request to any page in the application system.
10. An access service system, characterized in that: The system comprises at least one client (10) and at least one reverse proxy server (20); wherein: The at least one client (10) is used to determine whether the user has been authenticated when receiving a first access request from the user to the application system; wherein the first access request is an access request to any page in the application system; if the user has not been authenticated or the authentication has not passed, then obtain the domain name in the first access request; generate a second access address based on the domain name; wherein the second access address is different from the first access address in the first access request; generate a second access request including the second access address, and send the second access request to the reverse proxy server; The at least one reverse proxy server (20) is used to: determine that the access request sent by the client is a second access request; send the second access request to the authentication server of the application system according to the second access address in the second access request parsed, so that the authentication server provides user authentication services to the client; when it is determined that the access request sent by the client is a first access request, send the first access request to the front-end server of the application system according to the first access address in the first access request, so that the front-end server provides front-end business services to the client; wherein the second access address is different from the first access address in the first access request received by the client, and the second access address is generated according to the domain name in the first access request, the second access address includes the domain name, and the first access request is an access request to any page in the application system.
11. A computing device, characterized in that: The device includes: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 7.
12. A computer readable medium, characterized in that The computer readable medium stores computer instructions, and when the computer instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 7.
