System and method for solving the complexity of API gateway and third-party service authentication

Generating orchestration files through the low-code front-end GUI and utilizing the orchestratable authentication module solves the complexity problem of third-party authentication of API gateways, realizes the applicability of low-code orchestration and multiple authentication methods, and is suitable for passive devices of sensitive units. code used.

CN115529182BActive Publication Date: 2024-09-13CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211190306.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-28
Publication Date
2024-09-13
Estimated Expiration
2042-09-28

AI Technical Summary

Technical Problem

When integrating multiple third-party services, the third-party authentication process of existing API gateways is complex and repetitive, resulting in a heavy development workload, and sensitive units cannot use low-code API gateways for authentication without exposing internal algorithms.

Method used

Orchestrate through the low-code front-end GUI, generate orchestration files, use the authentication interpreter and executor in the orchestratable authentication module, and combine with built-in or third-party authentication libraries to realize the analysis and execution of authentication logic, supporting multiple authentication Authorization method, and introduce new authentication functions through a third-party authentication dynamic library.

Benefits of technology

It greatly reduces the development workload and authentication complexity, applies multiple authentication methods, and allows sensitive units to use low-code API gateways for authentication without exposing internal algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115529182B
    Figure CN115529182B
Patent Text Reader

Abstract

The present invention discloses a system and method for solving the complexity of API gateway and third-party service authentication. The system comprises: a low-code front-end GUI, an orchestration file module, and an arrangable authentication module connected in sequence. The arrangable authentication module comprises: an authentication interpreter, an executor, and an authentication library. The orchestration file module is connected to the authentication interpreter, and the authentication library is connected to the executor. The present invention generates an orchestration file by obtaining common functions, greatly reducing the development workload, reducing the complexity of authentication, and being applicable to a variety of authentication methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of API gateways, and in particular to a system and method for solving the complexity of API gateway and third-party service authentication. Background Art

[0002] There are two uses for API gateways. One is to expose the internal microservice combination and orchestration to third parties for use, and the other is to encapsulate third-party services for use by internal microservices. For the latter use, the API gateway will involve a large number of third-party authentications. There are currently two common modes. One is to calculate the checksum based on the APPID and some variables such as APPKEY and business content each time, and verify it on the server side; the other is to calculate the checksum based on the APPID combined with various variables such as UTC time, request a token, issue a token after verification on the server side, and use the token for subsequent calls. However, no matter which method is used, the calculation method of each third-party service may be different. When multiple third-party services need to be integrated, if a separate authentication function is written for each service, the development workload is large and repetitive. Summary of the invention

[0003] In response to the problems existing in the prior art, the present invention provides a system and method for solving the complexity of authentication of API gateways and third-party services. By obtaining common functions and generating orchestration files, the development workload is greatly reduced, the authentication complexity is reduced, and a variety of authentication methods are applicable.

[0004] To achieve the above-mentioned objectives, the present invention adopts the following technical solutions: a system for solving the complexity of API gateway and third-party service authentication, comprising a low-code front-end GUI, an orchestration file module, and a programmable authentication module connected in sequence, the programmable authentication module comprising: an authentication interpreter, an executor, and an authentication library, the orchestration file module is connected to the authentication interpreter, and the authentication library is connected to the executor.

[0005] Furthermore, the authentication library is a built-in authentication library or a third-party authentication library.

[0006] Furthermore, the third-party authentication library is imported through an external third-party authentication dynamic library.

[0007] The present invention also provides an authentication method for the system that solves the complexity of authentication of API gateway and third-party service, which specifically includes the following steps:

[0008] Step S1: According to the authentication requirements, obtain the corresponding authentication function, then obtain the common function, arrange the required parameters and logic calls of the common function on the front-end GUI side of the low-code platform, and generate an arrangement file;

[0009] Step S2: Define a built-in authentication function in the code of the low-code API gateway platform system according to the generated orchestration file, and store the built-in authentication function in the global mapping table according to the name;

[0010] Step S3: Start the low-code API gateway platform system and import the orchestration file into the low-code API gateway platform system;

[0011] Step S4: The low-code API gateway platform system receives an internal request. The low-code API gateway platform system inserts authentication information into the HTTP request to the third-party server according to the orchestration file and sends the authentication information to the third-party server.

[0012] Step S5: The third-party server performs an authentication check and returns the result to the low-code API gateway platform system; the low-code API gateway platform system then returns the result to the content caller.

[0013] Furthermore, when the interpreter parses the orchestration file, the corresponding authentication function is found in the global mapping table according to the name of the authentication function, and the executor directly calls it.

[0014] Furthermore, when the interpreter parses the orchestration file, the third-party authentication function is imported in the form of a third-party authentication dynamic library, so that the interpreter can directly use it when parsing the orchestration file, and the executor can directly call it.

[0015] Furthermore, the third-party authentication dynamic library defines a unified interface function, and the return value of the interface function is a mapping table type of the authentication function call name plus the authentication function pointer.

[0016] Furthermore, the fields included in the arrangement file are: "in", "name", "value", "from", "content", and "args".

[0017] Furthermore, the "in" is the location where parameters are written, including: "query", "header", "body", "vars"; the "from" is the location where parameters are obtained, including: fixed value literal, reading private from the key file, and calculating func through a function; the "content" includes: fixed value, key name, function name.

[0018] Furthermore, in step S5, if the authentication check passes, the result of the HTTP request is returned to the low-code API gateway platform system, and the low-code API gateway platform system returns the result of the HTTP request to the content caller; if the authentication check fails, the error code information is returned to the low-code API gateway platform system, and the low-code API gateway platform system returns the error code information to the content caller.

[0019] Compared with the prior art, the present invention has the following beneficial effects: the present invention converts the authentication of third parties from writing codes to operation and maintenance orchestration in the low-code front-end GUI to form an orchestration file, which greatly reduces the development workload, reduces the complexity of authentication, and is applicable to a variety of authentication methods; at the same time, the orchestration file is parsed by the authentication interpreter in the programmable authentication module to form the business logic of authentication; the present invention supports the introduction of new authentication functions from a third-party authentication dynamic library, thereby solving the problem that sensitive units, such as banks, do not need to provide source code, and use this low-code API gateway platform system for authentication without exposing internal algorithms. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A framework diagram of a system for solving the complexity of API gateway and third-party service authentication in the present invention;

[0021] Figure 2 The present invention is a flow chart of an authentication method for solving the complexity of authentication of API gateway and third-party services. DETAILED DESCRIPTION

[0022] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings and embodiments.

[0023] like Figure 1 The framework diagram of the system for solving the complexity of authentication of API gateway and third-party services of the present invention includes: a low-code front-end GUI, an orchestration file module, and an orchestration authentication module connected in sequence. The operation and maintenance personnel can orchestrate the business logic on the low-code front-end GUI side, and import parameters and algorithms on the low-code front-end GUI side according to the authentication logic to generate an orchestration file; the orchestration file module describes how to execute the authentication logic, specifically, obtain each parameter required in the authentication logic, call all input parameters and built-in or third-party authentication functions, and perform authentication. The programmable authentication module in the present invention includes: an authentication interpreter, an executor, and an authentication library. The orchestration file module is connected to the authentication interpreter, the authentication interpreter is used to read the orchestration file, and the authentication library is connected to the executor; the authentication library is a built-in authentication library or a third-party authentication library, and the authentication library is the specific execution content of the authentication function or related common functions arranged in the orchestration file; according to the authentication of the orchestration file, the authentication interpreter can directly find the corresponding authentication function to be called, and the executor executes the authentication logic. It can be seen that the system in the present invention that solves the complexity of authentication of API gateways and third-party services only needs to solve the authentication problem through low-code orchestration, which greatly reduces the development workload, reduces the complexity of authentication, and is applicable to multiple authentication methods.

[0024] The authentication library in the present invention can be imported into the third-party authentication library in the form of a third-party authentication dynamic library to meet the needs of sensitive units without providing source code. Under the premise of not exposing the internal algorithm, this low-code API gateway platform system is used for authentication. Figure 2 The flowchart of the authentication method of the present invention for solving the complexity of authentication between API gateway and third-party service, the authentication method specifically includes the following steps:

[0025] Step S1. According to the authentication requirements, obtain the corresponding authentication function, and then obtain the common function, and orchestrate the required parameters and logic calls of the common function on the front-end GUI side of the low-code platform to generate an orchestration file. Switch from writing code to operation and maintenance to orchestrate in the low-code front-end GUI to form an orchestration file, which greatly reduces the development workload and is applicable to multiple authentication methods.

[0026] The fields included in the arrangement file of the present invention are: "in", "name", "value", "from", "content", and "args"; "in" is the location where the parameters are written, including: "query", "header", "body", and "vars". "vars" indicates that this parameter is required by the subsequent function and needs to be recorded in a map[string]string named vars. In addition to being written into the HTTP request, other variables also need to be written into this "vars" for subsequent function calls; "name" is the parameter name, "value" is the parameter value, and "from" is the location for obtaining parameters, including: fixed value literal, reading private from the key file, and calculating func through a function. When "from" is "func", the input parameters of func need to be separated by spaces when multiple parameters are entered; "content" includes: fixed value, key name, and function name.

[0027] Step S2: Define the built-in authentication function in the code of the low-code API gateway platform system according to the generated orchestration file, and store the built-in authentication function in the global mapping table according to the name. The global mapping table is used to facilitate the executor to call; specifically, the authentication interpreter reads the orchestration file, and the result may be multiple steps, each step is the name of the authentication function to be executed and the operation method. The executor can directly find the authentication function call in the mapping table according to the name of the authentication function.

[0028] When the interpreter parses the orchestration file, it finds the corresponding authentication function in the global mapping table according to the name of the authentication function, and the executor calls it directly. When the source code is not provided, when the interpreter parses the orchestration file, it imports the third-party authentication function by importing the third-party authentication dynamic library, so that the interpreter can use it directly when parsing the orchestration file, and the executor calls it directly; at this time, the third-party authentication dynamic library needs to define a unified interface function, and the return value of the interface function is the mapping table type of the authentication function call name plus the authentication function pointer. In this way, the low-code API gateway platform system can directly call the interface function when importing the third-party authentication dynamic library, and import the authentication function into the global mapping table of the third-party authentication library without having to understand the specific implementation of the authentication function in the third-party authentication dynamic library.

[0029] Step S3: Start the low-code API gateway platform system and import the orchestration file into the low-code API gateway platform system;

[0030] Step S4, the low-code API gateway platform system receives an internal request without any authentication information of the third-party server. The low-code API gateway platform system inserts the authentication information into the HTTP request of the third-party server according to the orchestration file, and sends the authentication information to the third-party server. This allows multiple tenants to use external APIs without having to understand the authentication information and methods of the external APIs, and directly adopt the orchestration approach, reducing the difficulty of development. It can also prevent tenants from skipping the gateway and abusing external services.

[0031] Step S5: The third-party server performs an authentication check and returns the result to the low-code API gateway platform system; the low-code API gateway platform system then returns the result to the content caller; specifically, if the authentication check passes, the result of the HTTP request is returned to the low-code API gateway platform system, and the low-code API gateway platform system then returns the result of the HTTP request to the content caller; if the authentication check fails, the error code information is returned to the low-code API gateway platform system, and the low-code API gateway platform system then returns the error code information to the content caller.

[0032] The authentication method of the present invention that solves the complexity of authentication of API gateways and third-party services only needs to solve the authentication problem through low-code orchestration on the operation and maintenance side, which reduces the development difficulty, reduces the complexity of authentication, and is applicable to multiple authentication methods; at the same time, for multi-tenant situations, only orchestration is required to complete the authentication, and it can also prevent tenants from skipping the gateway and abusing external services.

[0033] Example 1

[0034] This embodiment takes the MD5 authentication method as an example. The client and the server both have the same apikey, but it will not be transmitted in the http request. The apikey is a key parameter for authentication. The authentication method of the present invention that solves the complexity of authentication of API gateway and third-party service is used to implement the authentication process:

[0035] In the low-code API gateway platform system, three headers need to be transmitted in the HTTP request sent. X-Appid is the user name for authentication, which is obtained from the key file of the low-code API gateway platform system; X-CurTime is the current time, which is to prevent replay attacks; apikey is the same authentication parameter stored on the server, which is obtained from the key file; X-CheckSum is the checkSum value of apikey and X-CurTime calculated by the MD5 algorithm. After receiving the request, the third-party server will query the stored apikey value based on the user name, and then use the general MD5 algorithm to verify the value of the X-CheckSum header field based on the X-CurTime value. If they are equal, the authentication is successful, otherwise the authentication fails. The fields of the orchestration file are described as follows:

[0036]

[0037] Call the utc function (no need to enter parameters) and write the X-CurTime header. Note that this value will also be recorded in vars for use by subsequent functions:

[0038]

[0039] Get the apikey from the key file

[0040]

[0041] Call the md5 function (two input parameters) and write the X-CheckSum header.

[0042]

[0043]

[0044] Example 2

[0045] This embodiment takes SHA1 authentication as an example. The client and the server both have the same apikey, but it will not be transmitted in the http request. The apikey is a key parameter for authentication. The authentication method of the present invention that solves the complexity of authentication between API gateway and third-party service is used to implement the authentication process:

[0046] In the low-code API gateway platform system, three headers need to be transmitted in the HTTP request sent. X-Appid is the user name for authentication, which is obtained from the key file of the low-code API gateway platform system; X-Rand is the generated random number; apikey is the same authentication parameter stored on the server, obtained from the key file; X-CheckSum is the checkSum value of apikey and X-Rand calculated by the SHA1 algorithm. After receiving the request, the third-party server will query the stored apikey value based on the user name, and then use the general SHA1 algorithm to verify the value of the X-CheckSum header field based on the X-Rand value. If they are equal, the authentication is successful, otherwise the authentication fails. The fields of the orchestration file are described as follows:

[0047] Get the value of appid from the key file and write it to the X-Appid header.

[0048]

[0049] Call the rand function (no parameters are required) and write the X-Rand header. Note that this value will also be recorded in vars for use by subsequent functions

[0050]

[0051]

[0052] Get the apikey from the key file

[0053]

[0054] Call the md5 function (two input parameters) and write the X-CheckSum header.

[0055]

[0056] From the above two embodiments, it can be concluded that the authentication method of the present invention for solving the complexity of authentication of API gateways and third-party services is applicable to various authentication logics of different manufacturers. No matter which authentication logic is used, low-code orchestration can be performed according to its different parameters and algorithms and according to the orchestration file fields of the low-code API gateway platform system to reduce the complexity of the authentication service.

[0057] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.

Claims

1. A system that solves the complexity of API gateway and third-party service authentication. It is characterized in that It includes a low-code front-end GUI, an orchestration file module, and an orchestration authentication module connected in sequence, wherein the low-code front-end GUI is used to orchestrate business logic, and according to the authentication logic, parameters and algorithms are imported on the low-code front-end GUI side to generate an orchestration file; The orchestration file module is used to obtain each parameter required in the authentication logic, call all parameters in the orchestration file, perform authentication through the built-in authentication function of the built-in authentication library in the programmable authentication module, or insert authentication information into the HTTP request of the third-party server according to the orchestration file, send the authentication information to the third-party server, the third-party server performs an authentication check, and returns the result to the low-code API gateway platform system; The programmable authentication module includes: an authentication interpreter, an executor and an authentication library, the programmable file module is connected to the authentication interpreter, and the authentication library is connected to the executor; The authentication interpreter is used to read the arrangement file, the authentication library is used to execute the specific content of the authentication function or related common functions arranged in the arrangement file, and the executor finds the authentication function according to the name of the authentication function and calls it for execution.

2. A system for solving the complexity of API gateway and third-party service authentication according to claim 1, It is characterized in that The authentication library is a built-in authentication library or a third-party authentication library.

3. A system for solving the complexity of API gateway and third-party service authentication according to claim 2, It is characterized in that The third-party authentication library is imported through an external third-party authentication dynamic library.

4. An authentication method for a system that solves the complexity of authentication between API gateways and third-party services as described in claim 1, It is characterized in that The specific steps include: Step S1: According to the authentication requirements, obtain the corresponding authentication function, then obtain the common function, arrange the required parameters and logic calls of the common function on the front-end GUI side of the low-code platform, and generate an arrangement file; Step S2: Define a built-in authentication function in the code of the low-code API gateway platform system according to the generated orchestration file, and store the built-in authentication function in the global mapping table according to the name; Step S3: Start the low-code API gateway platform system and import the orchestration file into the low-code API gateway platform system; Step S4: The low-code API gateway platform system receives an internal request. The low-code API gateway platform system inserts authentication information into the HTTP request to the third-party server according to the orchestration file and sends the authentication information to the third-party server. Step S5: The third-party server performs an authentication check and returns the result to the low-code API gateway platform system; The low-code API gateway platform system then returns the results to the content caller.

5. According to claim 4, a system authentication method for solving the complexity of API gateway and third-party service authentication, It is characterized in that When the interpreter parses the orchestration file, it finds the corresponding authentication function in the global mapping table according to the name of the authentication function, and the executor calls it directly.

6. According to claim 4, a system authentication method for solving the complexity of API gateway and third-party service authentication, It is characterized in that When the interpreter parses the orchestration file, the third-party authentication function is imported by importing the third-party authentication dynamic library, so that the interpreter can directly use it when parsing the orchestration file and the executor can directly call it.

7. According to claim 6, a system authentication method for solving the complexity of API gateway and third-party service authentication, It is characterized in that The third-party authentication dynamic library defines a unified interface function, and the return value of the interface function is a mapping table type of the authentication function call name plus the authentication function pointer.

8. According to claim 4, a system authentication method for solving the complexity of API gateway and third-party service authentication, It is characterized in that The fields included in the arrangement file are: "in", "name", "value", "from", "content" and "args".

9. According to claim 8, a system authentication method for solving the complexity of API gateway and third-party service authentication, It is characterized in that The "in" is the location where parameters are written, including: "query", "header", "body" and "vars"; the "from" is the location where parameters are obtained, including: fixed value literal, reading private from the key file, and calculating func through a function; the "content" includes: fixed value, key name and function name.

10. According to claim 4, a system authentication method for solving the complexity of API gateway and third-party service authentication, It is characterized in that In step S5, if the authentication check passes, the result of the HTTP request is returned to the low-code API gateway platform system, and the low-code API gateway platform system then returns the result of the HTTP request to the content caller; If the authentication check fails, the error code information will be returned to the low-code API gateway platform system, and the low-code API gateway platform system will then return the error code information to the content caller.