Access verification method and device, product and electronic equipment

By setting the tag configuration in the location block of the Nginx server, only the LDAP server verifies the LDAP identity and password, the cumbersome and operation and maintenance problems of access qualification configuration in LDAP and Nginx integration are solved, and the simplified access verification process and resources are realized Security.

CN118972138APending Publication Date: 2024-11-15NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411154570.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the prior art, the integration of LDAP and Nginx requires tedious access qualification configuration and high operation and maintenance difficulties, resulting in complex and difficult user authentication process.

Method used

Set the tag configuration in the location block of the Nginx server. Only the LDAP server verifies the LDAP identity and password. The access result is output when the tag configuration of the location block is hit, reducing the configuration complexity and operation and maintenance difficulty of the LDAP server.

Benefits of technology

Access verification is achieved by configuring the location block, which saves configuration operations, reduces operation and maintenance difficulties, and ensures the security of Nginx server resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972138A_ABST
    Figure CN118972138A_ABST
Patent Text Reader

Abstract

The invention provides an access verification method and device, a medium and equipment, and relates to the technical field of computers, and the method can respond to a user access request, and triggers an LDAP server to verify an LDAP identifier and a password corresponding to the user access request; receiving a verification result returned by the LDAP server, and if the verification result represents that the LDAP identifier is matched with the password, returning a characterization mark based on the LDAP server; and if the characterization mark hits the mark configuration of the location block in the Nginx server, determining that the verification is passed, and outputting an access result corresponding to the user access request. Compared with configuration of the LDAP, the access verification is realized by configuring the location block, so that the configuration operation can be saved. Moreover, the location block is located in the Nginx server, and the LDAP server is an external server, so that the operation and maintenance difficulty is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an access verification method, an access verification device, a computer program product, and an electronic device. Background Art

[0002] Nginx server is a high-performance, high-concurrency web server and reverse proxy server, which is used in websites and applications of various sizes. LDAP (Light Directory Access Portocol) is a lightweight directory access protocol, a database optimized for query, browsing and search, shaped like a tree structure.

[0003] In related technologies, in order to improve the security of information management, LDAP and Nginx are integrated so that user authentication can be sent to LDAP and LDAP is triggered to verify whether the user identity is legal and whether the user has access qualifications. After LDAP returns the verification result, Nginx can respond to the user with corresponding resources.

[0004] However, this method requires configuring access qualifications and other information in LDAP, which is cumbersome and difficult to operate and maintain.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute an existing solution known to ordinary technicians in the field. Summary of the invention

[0006] The purpose of the present application is to provide an access verification method, an access verification device, a computer-readable storage medium and an electronic device. By setting a tag configuration in the location block of the Nginx server, the feature tag verification based on the location block can be realized. In the access verification process, only the LDAP server needs to verify the LDAP identifier and password, and the LDAP server does not need to verify the feature tag. The feature tag is the key to responding to the user's access request. When the feature tag hits the tag configuration of the location block, the access result corresponding to the user's access request is output. Compared with configuring LDAP, the present application adopts the method of configuring the location block to realize access verification, which can save configuration operations. In addition, since the location block is in the Nginx server, and the LDAP server is an external server, the difficulty of operating and maintaining the location block in the Nginx server is lower than the difficulty of operating and maintaining the configuration in the LDAP server, which reduces the difficulty of operation and maintenance. In addition, since the tag configuration is set in the location block of the Nginx server, compared with setting the tag configuration in an external LDAP server, the security of resources in the Nginx server can also be ensured.

[0007] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0008] According to one aspect of the present application, there is provided an access verification method, the method comprising:

[0009] In response to a user access request, triggering the LDAP server to verify an LDAP identifier and password corresponding to the user access request;

[0010] receiving a verification result returned by the LDAP server, and if the verification result indicates that the verification LDAP identifier and the password match, then based on the characterization tag returned by the LDAP server;

[0011] If the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0012] In an exemplary embodiment of the present application, the characterization mark is implemented as a work number, and further includes:

[0013] Compare the employee number with the employee number list in the location block to get the comparison result;

[0014] If the comparison result indicates that the employee number is included in the employee number list, it is determined that the characterization tag hits the tag configuration of the location block.

[0015] In an exemplary embodiment of the present application, it further includes:

[0016] In response to a configuration modification operation on a location block, a modification result is determined and stored.

[0017] In an exemplary embodiment of the present application, it further includes:

[0018] Based on the target instruction parsing method, parse the target instruction to be configured in the location block to obtain the parsing result;

[0019] The parsing result is mounted in the location block; wherein the parsing result is at least used to record the tag configuration.

[0020] In an exemplary embodiment of the present application, the parsing result is mounted in a location block, including:

[0021] Define the scope of the target instruction in the parsing result into the location block;

[0022] Mount the parsing results in the access permission check phase of the Nginx server.

[0023] In an exemplary embodiment of the present application, the target instruction includes a require instruction for recording a tag configuration; the target instruction also includes at least one of the following: an ldap_url ldap instruction for recording an LDAP address, a binddn instruction for recording an LDAP identifier, a bindpasswd instruction for recording a password, and a loc_ldap_server instruction for recording LDAP server information.

[0024] In an exemplary embodiment of the present application, if the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output, including:

[0025] If the user access request is for accessing classified resources, request the LDAP server for the corresponding classified tag of the user access request;

[0026] The confidentiality tag is verified based on the confidentiality configuration in the location block. If the verification passes and the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0027] According to one aspect of the present application, there is provided an access verification device, comprising:

[0028] An information verification unit, configured to respond to a user access request and trigger an LDAP server to verify an LDAP identifier and a password corresponding to the user access request;

[0029] a tag acquisition unit, configured to receive a verification result returned by the LDAP server, and if the verification result indicates that the verification LDAP identifier and the password match, based on the characterized tag returned by the LDAP server;

[0030] The request response unit is used to determine that the verification is passed if the characterization tag hits the tag configuration of the location block in the Nginx server, and output the access result corresponding to the user access request.

[0031] In an exemplary embodiment of the present application, the characterization mark is implemented as a work number, and further includes:

[0032] The comparison unit is used to compare the work number with the work number list in the location block to obtain a comparison result; if the comparison result indicates that the work number is included in the work number list, it is determined that the characterization tag hits the tag configuration of the location block.

[0033] In an exemplary embodiment of the present application, it further includes:

[0034] The modification unit is used to determine and store the modification result in response to the configuration modification operation on the location block.

[0035] In an exemplary embodiment of the present application, it further includes:

[0036] A parsing unit, used for parsing the target instruction to be configured in the location block based on the target instruction parsing method, and obtaining a parsing result;

[0037] The mounting unit is used to mount the parsing result in the location block; wherein the parsing result is at least used to record the tag configuration.

[0038] In an exemplary embodiment of the present application, the mounting unit mounts the parsing result in a location block, including:

[0039] Define the scope of the target instruction in the parsing result into the location block;

[0040] Mount the parsing results in the access permission check phase of the Nginx server.

[0041] In an exemplary embodiment of the present application, the target instruction includes a require instruction for recording a tag configuration; the target instruction also includes at least one of the following: an ldap_url ldap instruction for recording an LDAP address, a binddn instruction for recording an LDAP identifier, a bindpasswd instruction for recording a password, and a loc_ldap_server instruction for recording LDAP server information.

[0042] In an exemplary embodiment of the present application, if the characterization tag hits the tag configuration of the location block in the Nginx server, the request response unit determines that the verification is passed, and outputs the access result corresponding to the user access request, including:

[0043] If the user access request is for accessing classified resources, request the LDAP server for the corresponding classified tag of the user access request;

[0044] The confidentiality tag is verified based on the confidentiality configuration in the location block. If the verification passes and the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0045] According to one aspect of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above methods is implemented.

[0046] According to one aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.

[0047] The exemplary embodiments of the present application may have some or all of the following beneficial effects:

[0048] In the access verification method provided by an example implementation of the present application, by setting a tag configuration in the location block of the Nginx server, the feature tag verification based on the location block can be realized. During the access verification process, only the LDAP server needs to verify the LDAP identifier and password, and the LDAP server does not need to verify the feature tag. The feature tag is the key to responding to the user's access request. When the feature tag hits the tag configuration of the location block, the access result corresponding to the user's access request is output. Compared with configuring LDAP, the present application adopts the method of configuring the location block to realize access verification, which can save configuration operations. In addition, since the location block is in the Nginx server and the LDAP server is an external server, the difficulty of operating and maintaining the location block in the Nginx server is lower than the difficulty of operating and maintaining the configuration in the LDAP server, which reduces the difficulty of operation and maintenance. In addition, since the tag configuration is set in the location block of the Nginx server, compared with setting the tag configuration in the external LDAP server, the security of the resources in the Nginx server can also be ensured. It should be understood that the above general description and the detailed description below are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0050] Figure 1 A flowchart of an access verification method according to an embodiment of the present application is schematically shown;

[0051] Figure 2 A flowchart of an access verification method according to another embodiment of the present application is schematically shown;

[0052] Figure 3 The structure block diagram of the access verification device according to one embodiment of the present application is schematically shown;

[0053] Figure 4 The structure diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0054] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present application will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.

[0055] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0056] See also Figure 1 , Figure 1 The following schematically shows a flow chart of an access verification method according to an embodiment of the present application. Figure 1 As shown, the access verification method may include: steps S110 to S130.

[0057] Step S110: In response to the user access request, trigger the LDAP server to verify the LDAP identification and password corresponding to the user access request.

[0058] Step S120: receiving the verification result returned by the LDAP server, and if the verification result indicates that the LDAP identifier and the password match, then based on the characterization tag returned by the LDAP server.

[0059] Step S130: If the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0060] Implementation Figure 1The method shown can realize the characterization tag verification based on the location block by setting the tag configuration in the location block of the Nginx server. During the access verification process, only the LDAP server needs to verify the LDAP identification and password, and the LDAP server does not need to verify the characterization tag. The characterization tag is the key to responding to the user access request. When the characterization tag hits the tag configuration of the location block, the access result corresponding to the user access request is output. Compared with configuring LDAP, this application adopts the method of configuring the location block to realize access verification, which can save configuration operations. In addition, since the location block is in the Nginx server and the LDAP server is an external server, the difficulty of operating and maintaining the location block in the Nginx server is lower than the difficulty of operating and maintaining the configuration in the LDAP server, which reduces the difficulty of operation and maintenance. In addition, since the tag configuration is set in the location block of the Nginx server, compared with setting the tag configuration in an external LDAP server, the security of resources in the Nginx server can also be ensured.

[0061] Next, the above steps of this exemplary embodiment are described in more detail.

[0062] In the related art, the method of implementing user authentication is to trigger the Nginx LDAP Auth module to communicate with the IDAP server through the python proxy service to proxy the trigger authentication of the IDAP server and return the result of allowing the request / rejecting the request based on the authentication result. Among them, the Nginx LDAP Auth module is used to allow the Nginx server to interact with the LDAP server to perform authentication on HTTP requests, and can be integrated in the Nginx server.

[0063] However, the Nginx LDAP Auth module requires a python proxy service to trigger authentication on the IDAP server. This requires relevant personnel to configure the parameters of the IDAP server so that the IDAP server can complete the authentication process. The configuration process is relatively complex, has low reusability, and is difficult to operate and maintain.

[0064] Based on this, this application can implement authentication configuration for the Nginx server to reduce the complexity of the configuration process, improve reusability, and reduce the difficulty of operation and maintenance.

[0065] In step S110 , in response to a user access request, the LDAP server is triggered to verify an LDAP identifier and a password corresponding to the user access request.

[0066] Specifically, the user access request can be a request based on the HTTP protocol or a request based on other protocols, which is not limited in the embodiments of the present application. After receiving the user access request, the LDAP server can be triggered to first verify the LDAP identifier and password. The LDAP server is used to verify whether the LDAP identifier exists and whether the LDAP identifier and password match. Among them, the user access request contains the LDAP identifier and password, and the user access request is used to request server resources from the Nginx server. The server resources can be resources such as text, images, and videos.

[0067] Among them, the LDAP identifier can be called a distinguished name (DN), which is used as a user representation in the LDAP server. The directory in LDAP is in a tree structure. The directory consists of entries, which are equivalent to records in a table in a relational database. An entry is a set of attributes with a distinguished name DN. D is equivalent to the primary key in a relational database table. An attribute consists of a type and multiple values, which is equivalent to a field in a relational database consisting of a domain name and a data type. In other words, D is the name of the LDAP record item, and all record items in the LDAP directory have a unique DN.

[0068] In step S120, a verification result returned by the LDAP server is received. If the verification result indicates that the LDAP identifier and the password match, a characterization tag returned by the LDAP server is used.

[0069] Specifically, the characterization tag can be any user-configured tag, and the characterization tag can be any tag such as work number, level, position, age, education, etc. The characterization tag is stored in the Nginx server and configured in the location block of the Nginx server, so that relevant personnel can change it at any time. Configuring the characterization tag in the location block can reduce the configuration difficulty. Among them, the location block is used to specify different Nginx configurations for the uniform resource identifiers (URIs) of different requests.

[0070] As an optional embodiment, it also includes:

[0071] Based on the target instruction parsing method, parse the target instruction to be configured in the location block to obtain the parsing result;

[0072] The parsing result is mounted in the location block; wherein the parsing result is at least used to record the tag configuration.

[0073] The target instruction includes a require instruction for recording tag configuration; the target instruction also includes at least one of the following: an ldap_url ldap instruction for recording an LDAP address, a binddn instruction for recording an LDAP identifier, a bindpasswd instruction for recording a password, and a loc_ldap_server instruction for recording LDAP server information.

[0074] It can be seen that the implementation of this optional embodiment takes into account the problem that the location block usually cannot be configured. However, in order to improve the convenience of configuration, a target instruction that can be used in the location block is determined. Configuring the target instruction in the location block can improve the convenience and verification efficiency of user access authentication.

[0075] Specifically, the target instruction parsing method is used to indicate the operation method, storage location, etc. of the target instruction. The target instruction can be specified by relevant personnel or traversed and queried from the instruction set. The target instruction refers to a special instruction that can be configured in the location block.

[0076] Exemplarily, based on the target instruction parsing method, the target instruction to be configured in the location block is parsed to obtain the parsing result, and after the parsing result is mounted in the location block, the following configuration result of the location block can be obtained:

[0077]

[0078]

[0079] As an optional embodiment, the parsing result is mounted in the location block, including:

[0080] Define the scope of the target instruction in the parsing result into the location block;

[0081] Mount the parsing results in the access permission check phase of the Nginx server.

[0082] It can be seen that by implementing this optional embodiment, the scope of the target instruction in the parsing result can be defined in the location block, and the parsing result can be mounted in the access permission check phase of the Nginx server to realize the configuration of the location block so as to perform access verification based on the location block.

[0083] Specifically, the scope of the target instruction refers to the location where the execution result of the target instruction is realized, that is, in the location block. Mounting the parsing result in the access permission check phase of the Nginx server can enable the target instruction to be executed in the access permission check phase.

[0084] As an optional embodiment, the characterization mark is implemented as a work number, and further includes:

[0085] Compare the employee number with the employee number list in the location block to get the comparison result;

[0086] If the comparison result indicates that the employee number is included in the employee number list, it is determined that the characterization tag hits the tag configuration of the location block.

[0087] It can be seen that by implementing this optional embodiment, location block verification based on work numbers can be achieved. Work numbers are easy to configure and easy to distinguish users, which can improve verification efficiency.

[0088] Specifically, when the characteristic mark is a work number, relevant personnel can configure a list of work numbers that can access server resources in the location block, such as, work number list = {work number 1, work number 5, work number 9}. The work numbers in the work number list can be allowed to access server resources, which is conducive to improving the security of server resources and reducing the risk of resource leakage.

[0089] As an optional embodiment, it also includes:

[0090] In response to a configuration modification operation on a location block, a modification result is determined and stored.

[0091] It can be seen that implementing this optional embodiment can provide users with a configuration modification function so that users can change the configuration of the location block at any time according to their needs.

[0092] Specifically, the present application supports the configuration modification function for the location block. Compared with the related art, the user only needs to modify the location block to change the configuration, without having to log in to the LDAP server and add / delete configuration on the LDAP server, which can reduce the configuration difficulty.

[0093] In step S130, if the characterization tag hits the tag configuration of the location block in the Nginx server, it is determined that the verification is passed, and the access result corresponding to the user access request is output.

[0094] Specifically, if the characterization tag does not hit the tag configuration of the location block in the Nginx server, the process ends, and further, a prompt message can be output to prompt the user that the user does not belong to the specified user and therefore cannot access the server resources. In addition, the access result corresponding to the user access request refers to the server resource requested by the user access request.

[0095] As an optional embodiment, if the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output, including:

[0096] If the user access request is for accessing classified resources, request the LDAP server for the corresponding classified tag of the user access request;

[0097] The confidentiality tag is verified based on the confidentiality configuration in the location block. If the verification passes and the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0098] It can be seen that implementing this optional embodiment can further improve the security of server resources and avoid resource leakage.

[0099] Specifically, the confidentiality mark is a mark that is different from the characterization mark, such as the importance score. If the user passes the characterization mark verification, it means that the user is qualified to access the server resources. If the user passes the confidentiality mark verification, it means that the user is qualified to access the requested resources, and the requested resources belong to the confidential resources in the server resources.

[0100] See also Figure 2 , Figure 2 The following schematically shows a flow chart of an access verification method according to another embodiment of the present application. Figure 2 As shown, the access verification method includes: steps S210 to S250.

[0101] Step S210: based on the target instruction parsing method, the target instruction to be configured in the location block is parsed to obtain a parsing result; wherein the target instruction includes a require instruction for recording a tag configuration; the target instruction also includes at least one of the following: an ldap_url ldap instruction for recording an LDAP address, a binddn instruction for recording an LDAP identifier, a bindpasswd instruction for recording a password, and a loc_ldap_server instruction for recording LDAP server information.

[0102] Step S220: define the scope of the target instruction in the parsing result into the location block, and mount the parsing result in the access permission checking stage of the Nginx server.

[0103] Step S230: In response to the user access request, trigger the LDAP server to verify the LDAP identification and password corresponding to the user access request.

[0104] Step S240: receiving the verification result returned by the LDAP server, and if the verification result indicates that the LDAP identifier and the password match, then based on the characterization tag returned by the LDAP server.

[0105] Step S250: If the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0106] It should be noted that steps S210 to S250 are Figure 1 The steps and embodiments shown correspond to Figure 2 For the specific implementation of the steps, please refer to Figure 1 The steps and embodiments shown are not described in detail here.

[0107] It can be seen that implementation Figure 2 The method shown can realize the characterization tag verification based on the location block by setting the tag configuration in the location block of the Nginx server. During the access verification process, only the LDAP server needs to verify the LDAP identification and password, and the LDAP server does not need to verify the characterization tag. The characterization tag is the key to responding to the user access request. When the characterization tag hits the tag configuration of the location block, the access result corresponding to the user access request is output. Compared with configuring LDAP, this application adopts the method of configuring the location block to realize access verification, which can save configuration operations. In addition, since the location block is in the Nginx server and the LDAP server is an external server, the difficulty of operating and maintaining the location block in the Nginx server is lower than the difficulty of operating and maintaining the configuration in the LDAP server, which reduces the difficulty of operation and maintenance. In addition, since the tag configuration is set in the location block of the Nginx server, compared with setting the tag configuration in an external LDAP server, the security of resources in the Nginx server can also be ensured.

[0108] See also Figure 3 , Figure 3 The structure block diagram of the access verification device according to an embodiment of the present application is schematically shown. Figure 1 The method shown corresponds to Figure 3 As shown, the access verification device 300 includes:

[0109] The information verification unit 301 is used to trigger the LDAP server to verify the LDAP identification and password corresponding to the user access request in response to the user access request;

[0110] The tag acquisition unit 302 is used to receive the verification result returned by the LDAP server, and if the verification result indicates that the verification LDAP identifier and the password match, then based on the characterization tag returned by the LDAP server;

[0111] The request response unit 303 is used to determine that the verification is passed if the characterization tag hits the tag configuration of the location block in the Nginx server, and output the access result corresponding to the user access request.

[0112] It can be seen that implementation Figure 3 The device shown can realize the characterization tag verification based on the location block by setting the tag configuration in the location block of the Nginx server. During the access verification process, only the LDAP server needs to verify the LDAP identification and password, and the LDAP server does not need to verify the characterization tag. The characterization tag is the key to responding to the user access request. When the characterization tag hits the tag configuration of the location block, the access result corresponding to the user access request is output. Compared with configuring LDAP, the present application adopts the method of configuring the location block to realize access verification, which can save configuration operations. In addition, since the location block is in the Nginx server and the LDAP server is an external server, the difficulty of operating and maintaining the location block in the Nginx server is lower than the difficulty of operating and maintaining the configuration in the LDAP server, which reduces the difficulty of operation and maintenance. In addition, since the tag configuration is set in the location block of the Nginx server, compared with setting the tag configuration in the external LDAP server, the security of the resources in the Nginx server can also be ensured.

[0113] In an exemplary embodiment of the present application, the characterization mark is implemented as a work number, and further includes:

[0114] The comparison unit is used to compare the work number with the work number list in the location block to obtain a comparison result; if the comparison result indicates that the work number is included in the work number list, it is determined that the characterization tag hits the tag configuration of the location block.

[0115] It can be seen that by implementing this optional embodiment, location block verification based on work numbers can be achieved. Work numbers are easy to configure and easy to distinguish users, which can improve verification efficiency.

[0116] In an exemplary embodiment of the present application, it further includes:

[0117] The modification unit is used to determine and store the modification result in response to the configuration modification operation on the location block.

[0118] It can be seen that implementing this optional embodiment can provide users with a configuration modification function so that users can change the configuration of the location block at any time according to their needs.

[0119] In an exemplary embodiment of the present application, it further includes:

[0120] A parsing unit, used for parsing the target instruction to be configured in the location block based on the target instruction parsing method, and obtaining a parsing result;

[0121] The mounting unit is used to mount the parsing result in the location block; wherein the parsing result is at least used to record the tag configuration.

[0122] The target instruction includes a require instruction for recording tag configuration; the target instruction also includes at least one of the following: an ldap_url ldap instruction for recording an LDAP address, a binddn instruction for recording an LDAP identifier, a bindpasswd instruction for recording a password, and a loc_ldap_server instruction for recording LDAP server information.

[0123] It can be seen that the implementation of this optional embodiment takes into account the problem that the location block usually cannot be configured. However, in order to improve the convenience of configuration, a target instruction that can be used in the location block is determined. Configuring the target instruction in the location block can improve the convenience and verification efficiency of user access authentication.

[0124] In an exemplary embodiment of the present application, the mounting unit mounts the parsing result in a location block, including:

[0125] Define the scope of the target instruction in the parsing result into the location block;

[0126] Mount the parsing results in the access permission check phase of the Nginx server.

[0127] It can be seen that by implementing this optional embodiment, the scope of the target instruction in the parsing result can be defined in the location block, and the parsing result can be mounted in the access permission check phase of the Nginx server to realize the configuration of the location block so as to perform access verification based on the location block.

[0128] In an exemplary embodiment of the present application, if the characterization tag hits the tag configuration of the location block in the Nginx server, the request response unit 303 determines that the verification is passed, and outputs the access result corresponding to the user access request, including:

[0129] If the user access request is for accessing classified resources, request the LDAP server for the corresponding classified tag of the user access request;

[0130] The confidentiality tag is verified based on the confidentiality configuration in the location block. If the verification passes and the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

[0131] It can be seen that implementing this optional embodiment can further improve the security of server resources and avoid resource leakage.

[0132] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0133] Since the various functional modules of the access verification device in the example embodiment of the present application correspond to the steps of the example embodiment of the access verification method described above, for details not disclosed in the device embodiment of the present application, please refer to the above-mentioned access verification method embodiment of the present application.

[0134] See also Figure 4 , Figure 4 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0135] It should be noted that Figure 4 The computer system 400 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0136] like Figure 4 As shown, computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage part 408 into a random access memory (RAM) 403. Various programs and data required for system operation are also stored in RAM 403. CPU 401, ROM 402 and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to bus 404.

[0137] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.

[0138] In particular, according to an embodiment of the present application, the process described with reference to the flowchart above can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 409, and / or installed from a removable medium 411. When the computer program is executed by a central processing unit (CPU) 401, various functions defined in the method and apparatus of the present application are executed.

[0139] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the access verification method described above is implemented.

[0140] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.

[0141] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0142] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0143] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals, thereby running computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned access verification method, which includes the following steps: in response to a user access request, triggering an LDAP server to verify the LDAP identifier and password corresponding to the user access request; receiving a verification result returned by the LDAP server, if the verification result indicates that the verification LDAP identifier and the password match, then based on the characterization tag returned by the LDAP server; if the characterization tag hits the tag configuration of the location block in the Nginx server, it is determined that the verification is passed, and the access result corresponding to the user access request is output.

[0144] By executing the above method steps through a computer program, the tag configuration can be set in the location block of the Nginx server, so that the characterization tag verification based on the location block can be realized. During the access verification process, only the LDAP server needs to verify the LDAP identification and password, and the LDAP server does not need to verify the characterization tag. The characterization tag is the key to responding to the user's access request. When the characterization tag hits the tag configuration of the location block, the access result corresponding to the user's access request is output. Compared with configuring LDAP, the present application adopts the method of configuring the location block to realize access verification, which can save configuration operations. In addition, since the location block is in the Nginx server, and the LDAP server is an external server, the difficulty of operating and maintaining the location block in the Nginx server is lower than the difficulty of operating and maintaining the configuration in the LDAP server, which reduces the difficulty of operation and maintenance. In addition, since the tag configuration is set in the location block of the Nginx server, compared with setting the tag configuration in an external LDAP server, the security of resources in the Nginx server can also be ensured.

[0145] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0146] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0147] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.

Claims

1. An access verification method, characterized in that: include: In response to a user access request, triggering the LDAP server to verify an LDAP identifier and a password corresponding to the user access request; receiving a verification result returned by the LDAP server, and if the verification result indicates that the verification LDAP identifier and the password match, then based on the characterization tag returned by the LDAP server; If the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output.

2. The method according to claim 1, characterized in that The characterization mark is implemented as a work number, and further includes: Compare the employee number with the employee number list in the location block to obtain a comparison result; If the comparison result indicates that the work number is included in the work number list, it is determined that the characterization tag hits the tag configuration of the location block.

3. The method according to claim 1, characterized in that Also includes: In response to the configuration modification operation on the location block, a modification result is determined and stored.

4. The method according to claim 1, characterized in that Also includes: Based on the target instruction parsing method, the target instruction to be configured in the location block is parsed to obtain a parsing result; The parsing result is mounted in the location block; wherein the parsing result is at least used to record the tag configuration.

5. The method according to claim 4, characterized in that Mounting the parsing result in the location block includes: Define the scope of the target instruction in the parsing result into the location block; The parsing result is mounted in the access permission checking stage of the Nginx server.

6. The method according to claim 4, characterized in that The target instruction includes a require instruction for recording a tag configuration; the target instruction also includes at least one of the following: an ldap_url ldap instruction for recording an LDAP address, a binddn instruction for recording an LDAP identifier, a bindpasswd instruction for recording a password, and a loc_ldap_server instruction for recording LDAP server information.

7. The method according to claim 1, characterized in that If the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be successful, and the access result corresponding to the user access request is output, including: If the user access request is for accessing classified resources, requesting the LDAP server for a classified tag corresponding to the user access request; The confidentiality level tag is verified based on the confidentiality level configuration in the location block. If the verification passes and the characterization tag hits the tag configuration of the location block in the Nginx server, the verification is determined to be passed, and the access result corresponding to the user access request is output.

8. An access verification device, characterized in that: include: An information verification unit, configured to respond to a user access request and trigger an LDAP server to verify an LDAP identifier and a password corresponding to the user access request; a tag acquisition unit, configured to receive a verification result returned by the LDAP server, and if the verification result indicates that the verification LDAP identifier and the password match, based on the characterization tag returned by the LDAP server; The request response unit is used to determine that the verification is passed if the characterization tag hits the tag configuration of the location block in the Nginx server, and output the access result corresponding to the user access request.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.