Multi-platform interface authentication method and system and electronic equipment
By designing a unified authentication service interface and Java SPI mechanism, modularization and automatic adaptation of multi-platform interface authentication are achieved, solving the problems of large differences in authentication mechanisms, complex implementation, and difficult expansion, and improving the scalability and flexibility of the system.
Patent Information
- Application Number
- CN202510948528.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-10
- Publication Date
- 2025-09-16
AI Technical Summary
In multi-platform interface authentication, existing technologies have problems such as large differences in authentication mechanisms, complex implementation, and difficulty in expansion, resulting in high system coupling, high development costs, and insufficient flexibility.
Design a unified authentication service interface and load authentication logic for different platforms through the Java SPI mechanism to achieve modularization and automatic adaptation of the authentication process. Use the unified authentication interface and plug-in mechanism to dynamically load authentication service implementation classes of various categories.
It realizes unified management and security control of multi-platform authentication, reduces system complexity, improves scalability and flexibility, and reduces development costs.
Smart Images

Figure CN120658487A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interface authentication, and in particular to a multi-platform interface authentication method, system, electronic equipment and computer-readable storage medium. Background Art
[0002] In multi-platform interface authentication, when integrating multiple third-party platforms (such as the Meituan development platform and the Jushuitan open platform), the user system faces the following background technical issues and technical shortcomings:
[0003] 1. Wide variations in authentication mechanisms: Different third-party platforms have different authentication mechanisms, which means that when performing multi-platform interface authentication, it is necessary to design and implement specific authentication processes for each platform.
[0004] 2. Complex implementation: Since each platform has different authentication requirements and processes, integrating the authentication mechanisms of these platforms increases system complexity;
[0005] 3. Difficulty in expansion: When a third-party platform needs to be added or replaced, the existing system architecture is difficult to quickly adapt to new authentication requirements, resulting in poor scalability.
[0006] Therefore, during the integration of multiple platform interfaces, the following technical integration difficulties will be encountered:
[0007] 1. High coupling: Since the authentication process for each platform is highly customized, the system is highly coupled with each platform, which is not conducive to maintenance and upgrades.
[0008] 2. High development costs: Each addition or modification of an authentication mechanism requires a significant investment of manpower and time, resulting in low overall development efficiency.
[0009] 3. Lack of flexibility: Faced with the ever-changing certification standards of third-party platforms, the existing system lacks sufficient flexibility to respond and adjust quickly.
[0010] Therefore, in the field of multi-platform interface authentication, there is an urgent need for a solution that can uniformly handle authentication mechanisms of different platforms, reduce implementation complexity and improve scalability. Summary of the Invention
[0011] In order to solve the technical problems existing in the prior art, the present invention provides the following technical solutions:
[0012] In one aspect, a multi-platform interface authentication method is provided, which is implemented by an electronic device and includes:
[0013] S1. Interface authentication API request sent by the third-party platform to the user system;
[0014] S2. The user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories;
[0015] S3. The user system calls the matched authentication service implementation class to authenticate the interface authentication API request issued by the third-party platform;
[0016] S4. Complete the authentication and establish the interface authentication communication between the user system and the third-party platform.
[0017] Preferably, the method further comprises:
[0018] Pre-deploy a unified authentication interface on the user system;
[0019] After the user system verifies the API source, it calls the unified authentication interface, starts calling various authentication service implementation classes and matches the API source;
[0020] When the authentication service implementation class corresponding to the API source is matched, proceed to step S3.
[0021] Preferably, in step S2, when the user system receives the interface authentication API request and determines the API source, it also includes:
[0022] View the registry of each category of authentication service implementation class;
[0023] Determine whether there is a third-party platform corresponding to the API source in the registry:
[0024] If it exists, the user system is allowed to call the unified authentication interface;
[0025] If it does not exist, the interface authentication API request of the third-party platform will be rejected.
[0026] Preferably, the user system is configured with a call authentication class loader, a unified authentication loader and an SPI service registration and discovery system, wherein:
[0027] The unified authentication interface is configured on the unified authentication loader and is used as an interface for the unified authentication loader to receive the interface authentication API request;
[0028] Calling the authentication class loader to call the custom authentication jar pre-packaged by the third-party platform, wherein the custom authentication jar contains the authentication service implementation class of the corresponding category; and after authenticating the custom authentication jar, loading the custom authentication jar corresponding to each category into the unified authentication loader;
[0029] A unified authentication loader is used to register the custom authentication jars of each category into the SPI service registration and discovery system based on the Java SPI mechanism, thereby registering and generating the authentication service implementation classes of each category in the SPI service registration and discovery system;
[0030] The SPI service registration and discovery system is used to dynamically load the authentication service implementation classes of various categories through Service Loader.
[0031] Preferably, S2, the user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories, including:
[0032] The user system sends a call request to the unified authentication loader through the unified authentication interface, and the request includes the API source;
[0033] The unified authentication loader sends the API source to the SPI service registration and discovery system, matches the authentication service implementation class corresponding to the API source from the SPI service registration and discovery system, and feeds back to the unified authentication loader;
[0034] The unified authentication loader feeds back the fed-back authentication service implementation class to the user system through the unified authentication interface.
[0035] On the other hand, a multi-platform interface authentication system is provided, which is used to implement the multi-platform interface authentication method described above, and the system includes:
[0036] Third-party platform, used to send interface authentication API requests to user systems;
[0037] The user system is used to receive the interface authentication API request and determine the API source, and match the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories;
[0038] And, calling the matched authentication service implementation class to authenticate the interface authentication API request issued by the third-party platform; completing the authentication, and establishing interface authentication communication between the user system and the third-party platform;
[0039] The third-party platform is in communication connection with the user system.
[0040] On the other hand, an electronic device is provided, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the multi-platform interface authentication methods described above is implemented.
[0041] On the other hand, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned multi-platform interface authentication methods.
[0042] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0043] According to the present invention, when a third-party platform sends an interface authentication API request to a user system, the user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories; the user system calls the matched authentication service implementation class to authenticate the interface authentication API request sent by the third-party platform; after authentication is completed, interface authentication communication is established between the user system and the third-party platform. By designing a unified authentication service interface and loading authentication logic implementations of different platforms based on a plug-in mechanism (such as JavaSPI), the authentication process can be modularized and automatically adapted. This solves technical problems such as large differences in authentication mechanisms, complex implementation, and difficulty in expansion in the current system during the integration of multiple third-party platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a flow chart of a multi-platform interface authentication method provided by an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of a mechanism for a third-party platform to issue an interface authentication according to an embodiment of the present invention;
[0047] Figure 3 This is a code operation diagram of an interface authentication encapsulation logic provided by an embodiment of the present invention;
[0048] Figure 4 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0050] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.
[0051] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same. The terms "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same.
[0052] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript form such as W1. When the difference is not emphasized, the meanings to be expressed are the same.
[0053] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0054] The embodiment of the present invention provides a multi-platform interface authentication method, which can be implemented by an electronic device, which can be a terminal or a server. Figure 1 The flowchart of a multi-platform interface authentication method shown in FIG. 1 may include the following steps:
[0055] S1. Interface authentication API request sent by the third-party platform to the user system;
[0056] S2. The user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories;
[0057] S3. The user system calls the matched authentication service implementation class to authenticate the interface authentication API request issued by the third-party platform;
[0058] S4. Complete the authentication and establish the interface authentication communication between the user system and the third-party platform.
[0059] This invention achieves modularity and automatic adaptation of the authentication process by designing a unified authentication service interface and loading authentication logic implementations for different platforms based on a plug-in mechanism (such as Java SPI). This approach defines a unified authentication interface and provides specific authentication implementation classes for each platform. These implementation classes are registered with the system using the Java SPI mechanism, and the required authentication implementation is dynamically loaded via ServiceLoader.
[0060] Combined with attachment Figure 2 As shown, the present invention pre-encapsulates the interface authentication logic of each third-party platform into a corresponding custom authentication jar, which is then loaded and installed by the user system and registered within the internal system (stored in the registry). Upon receiving a subsequent interface authentication request from a third-party platform, a unified authentication service interface is designed and the authentication logic implementations for different platforms are loaded using a plug-in mechanism (such as Java SPI), thereby achieving modularization and automatic adaptation of the authentication process.
[0061] like Figure 3 As shown, you can pre-define an interface authentication interface, encapsulate the authentication logic, and generate a custom authentication jar.
[0062] Create a specific authentication implementation class for each platform to implement the interface authentication interface, such as MeituanAuthService, JushuitanAuthService, etc. Each implementation class corresponds to a platform authentication.
[0063] For example, MeituanAuthService, JushuitanAuthService, etc., each implementation class corresponds to a platform authentication. Create a file named after the platform type in the META-INF / services directory. The file content is the platform type name of each implementation class. The code example is as follows:
[0064] public class MeituanAuthService implements AuthService {
[0065] / / Meituan platform authentication service implementation class, specifically handling the authentication logic of the Meituan platform
[0066] public class MeituanAuthService implements AuthService {
[0067] / / Application ID assigned by the Meituan platform
[0068] private static final String APP_ID = "your_meituan_app_id";
[0069] / / RSA private key, used to generate signature
[0070] private static final String PRIVATE_KEY = "your_rsa_private_key";
[0071] / / Determine whether the current service supports the specified platform encoding
[0072] @Override
[0073] public boolean supports(String platformCode) {
[0074] / / Return true when the platform code is "meituan" (case insensitive)
[0075] return "meituan".equalsIgnoreCase(platformCode);
[0076] }
[0077] / / Generate the parameter set required for authentication
[0078] @Override
[0079] public Map<String, String> generateAuthParams(Map<String, String> requestParams) {
[0080] / / Get the current timestamp (milliseconds)
[0081] String timestamp = String.valueOf(System.currentTimeMillis());
[0082] / / Construct the content to be signed (example format, actual parameters must be spliced according to Meituan specifications)
[0083] String content = "app_id=" + APP_ID + "×tamp=" + timestamp +...;
[0084] / / Use the RSA private key to sign the content
[0085] String sign = RSAUtil.sign(content, PRIVATE_KEY);
[0086] / / Create an authentication parameter set
[0087] Map<String, String> authParams = new HashMap<>();
[0088] authParams. ; / / Add application ID
[0089] authParams.put("timestamp", timestamp); / / Add timestamp
[0090] authParams.put("sign", sign); / / Add digital signature
[0091] return authParams;
[0092] }
[0093] } .
[0095] File path: META-INF / services / com.guandata.auth.AuthService;
[0096] Content: com.guandata.auth.impl.MeituanAuthService.
[0097] When the interface is called, the required authentication implementation class is loaded through ServiceLoader and its authentication method is called.
[0098] The specific implementation scheme of this scheme will be described in detail below.
[0099] Preferably, the method further comprises:
[0100] Pre-deploy a unified authentication interface on the user system;
[0101] After the user system verifies the API source, it calls the unified authentication interface, starts calling various authentication service implementation classes and matches the API source;
[0102] When the authentication service implementation class corresponding to the API source is matched, proceed to step S3.
[0103] Preferably, in step S2, when the user system receives the interface authentication API request and determines the API source, it also includes:
[0104] View the registry of each category of authentication service implementation class;
[0105] Determine whether there is a third-party platform corresponding to the API source in the registry:
[0106] If it exists, the user system is allowed to call the unified authentication interface;
[0107] If it does not exist, the interface authentication API request of the third-party platform will be rejected.
[0108] Preferably, the user system is configured with a call authentication class loader, a unified authentication loader and an SPI service registration and discovery system, wherein:
[0109] The unified authentication interface is configured on the unified authentication loader and is used as an interface for the unified authentication loader to receive the interface authentication API request;
[0110] Calling the authentication class loader to call the custom authentication jar pre-packaged by the third-party platform, wherein the custom authentication jar contains the authentication service implementation class of the corresponding category; and after authenticating the custom authentication jar, loading the custom authentication jar corresponding to each category into the unified authentication loader;
[0111] A unified authentication loader is used to register the custom authentication jars of each category into the SPI service registration and discovery system based on the Java SPI mechanism, thereby registering and generating the authentication service implementation classes of each category in the SPI service registration and discovery system;
[0112] The SPI service registration and discovery system is used to dynamically load the authentication service implementation classes of various categories through Service Loader.
[0113] Preferably, S2, the user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories, including:
[0114] The user system sends a call request to the unified authentication loader through the unified authentication interface, and the request includes the API source;
[0115] The unified authentication loader sends the API source to the SPI service registration and discovery system, matches the authentication service implementation class corresponding to the API source from the SPI service registration and discovery system, and feeds back to the unified authentication loader;
[0116] The unified authentication loader feeds back the fed-back authentication service implementation class to the user system through the unified authentication interface.
[0117] Implementation principles and implementation examples of multi-platform interface authentication methods
[0118] S1: Request reception
[0119] The third-party platform initiates an API request to the user system to initiate the authentication process. This is the starting point of the entire authentication process.
[0120] S2: Source Identification and Matching
[0121] After receiving the request, the user system performs the following operations:
[0122] 1. Analyze the API source platform identifier;
[0123] 2. Query the SPI service registry;
[0124] 3. Match the authentication service implementation class of the corresponding platform.
[0125] For example: When the WeChat platform initiates a request, the system matches the WeChat-specific authentication class.
[0126] Registry Authentication Mechanism:
[0127] Perform security verification simultaneously during the source identification phase:
[0128] 1. Check whether the requesting platform is registered in the whitelist;
[0129] 2. The unregistered platform directly rejects the request;
[0130] For example, an unregistered Twitter request will return a 403 error status code.
[0131] S3: Dynamic Authentication
[0132] Call the matching authentication service implementation class to execute:
[0133] 1. Platform-specific authentication logic;
[0134] 2. Digital signature / token validity verification;
[0135] For example: Alipay request triggers the encryption parameter verification process of Alipay SDK.
[0136] S4: Authentication establishment
[0137] After authentication is completed:
[0138] 1. Establish a two-way secure communication channel;
[0139] 2. Generate and exchange access credentials;
[0140] For example: generating time-sensitive access tokens and establishing a key exchange mechanism.
[0141] Core component collaboration mechanism:
[0142] Unified authentication interface, serving as the request processing hub:
[0143] 1. Receive all platform authentication requests
[0144] 2. Standardized request processing process
[0145] For example: receiving JSON format requests through a RESTful interface.
[0146] The SPI registration and discovery system implements dynamic service loading:
[0147] 1. Dynamically load JAR through ServiceLoader;
[0148] 2. Maintain platform-implementation class mapping relationship;
[0149] For example: register the WeChat authentication implementation class in the META-INF / services directory.
[0150] Call the authentication class loader to provide a secure loading environment:
[0151] 1. Verify the third-party JAR digital signature;
[0152] 2. Create a sandbox isolated execution environment;
[0153] For example: Verify the CA certificate of the TikTok SDK and load it into the secure container.
[0154] Therefore, this method achieves unified management and security control of multi-platform authentication through standardized interfaces, dynamic service loading and security verification mechanisms.
[0155] Based on the principle of the above method, on the other hand, a multi-platform interface authentication system is provided, which is used to implement the multi-platform interface authentication method described above, and the system includes:
[0156] Third-party platform, used to send interface authentication API requests to user systems;
[0157] The user system is used to receive the interface authentication API request and determine the API source, and match the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories;
[0158] And, calling the matched authentication service implementation class to authenticate the interface authentication API request issued by the third-party platform; completing the authentication, and establishing interface authentication communication between the user system and the third-party platform;
[0159] The third-party platform is in communication connection with the user system.
[0160] Please understand the system interaction in conjunction with the above methods.
[0161] Figure 4 is a structural diagram of an electronic device provided by an embodiment of the present invention, such as Figure 4 As shown, the electronic device may include the above Figure 3 Optionally, the electronic device 410 may include a first processor 2001 .
[0162] Optionally, the electronic device 410 may further include a memory 2002 and a transceiver 2003 .
[0163] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.
[0164] The following combination Figure 4 The components of the electronic device 410 are described in detail.
[0165] The first processor 2001 is the control center of the electronic device 410 and can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs) or one or more field programmable gate arrays (FPGAs).
[0166] Optionally, the first processor 2001 can execute various functions of the electronic device 410 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.
[0167] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 are shown in FIG.
[0168] In a specific implementation, as an embodiment, the electronic device 410 may also include multiple processors, such as Figure 4 1 and 2. The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0169] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled by the first processor 2001 for execution. The specific implementation method can refer to the above method embodiment and will not be repeated here.
[0170] Alternatively, the memory 2002 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001 or exist independently and accessed through the interface circuit ( Figure 4 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0171] The transceiver 2003 is used to communicate with a network device or a terminal device.
[0172] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 4The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0173] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently and communicate with the first processor 2001 through the interface circuit ( Figure 4 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0174] It should be noted that Figure 4 The structure of the electronic device 410 shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0175] In addition, the technical effects of the electronic device 410 can refer to the technical effects of the multi-platform interface authentication method described in the above method embodiment, and will not be repeated here.
[0176] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
[0177] It should also be understood that the memory in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0178] The above embodiments can be implemented in whole or in part via software, hardware (e.g., circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable system. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0179] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.
[0180] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0181] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0182] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0183] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, systems and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0184] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems, and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of the system or unit, which can be electrical, mechanical or other forms.
[0185] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0186] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0187] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical disks.
[0188] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A multi-platform interface authentication method, characterized in that: The method comprises: S1. Interface authentication API request sent by the third-party platform to the user system; S2. The user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories; S3. The user system calls the matched authentication service implementation class to authenticate the interface authentication API request issued by the third-party platform; S4. Complete the authentication and establish the interface authentication communication between the user system and the third-party platform.
2. A multi-platform interface authentication method according to claim 1, characterized in that: The method further comprises: Pre-deploy a unified authentication interface on the user system; After the user system verifies the API source, it calls the unified authentication interface, starts calling various authentication service implementation classes and matches the API source; When the authentication service implementation class corresponding to the API source is matched, proceed to step S3.
3. A multi-platform interface authentication method according to claim 2, characterized in that: In step S2, when the user system receives the interface authentication API request and determines the API source, it also includes: View the registry of each category of authentication service implementation class; Determine whether there is a third-party platform corresponding to the API source in the registry: If it exists, the user system is allowed to call the unified authentication interface; If it does not exist, the interface authentication API request of the third-party platform will be rejected.
4. A multi-platform interface authentication method according to claim 1, characterized in that: The user system is configured with a call authentication class loader, a unified authentication loader, and an SPI service registration and discovery system, wherein: The unified authentication interface is configured on the unified authentication loader and is used as an interface for the unified authentication loader to receive the interface authentication API request; Calling the authentication class loader to call the custom authentication jar pre-packaged by the third-party platform, wherein the custom authentication jar contains the authentication service implementation class of the corresponding category; and after authenticating the custom authentication jar, loading the custom authentication jar corresponding to each category into the unified authentication loader; A unified authentication loader is used to register the custom authentication jars of each category into the SPI service registration and discovery system based on the Java SPI mechanism, thereby registering and generating the authentication service implementation classes of each category in the SPI service registration and discovery system; The SPI service registration and discovery system is used to dynamically load the authentication service implementation classes of various categories through Service Loader.
5. A multi-platform interface authentication method according to claim 4, characterized in that: S2. The user system receives the interface authentication API request and determines the API source, and matches the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories, including: The user system sends a call request to the unified authentication loader through the unified authentication interface, and the request includes the API source; The unified authentication loader sends the API source to the SPI service registration and discovery system, matches the authentication service implementation class corresponding to the API source from the SPI service registration and discovery system, and feeds back to the unified authentication loader; The unified authentication loader feeds back the fed-back authentication service implementation class to the user system through the unified authentication interface.
6. A multi-platform interface authentication system, the multi-platform interface authentication system is used to implement a multi-platform interface authentication method according to any one of claims 1 to 5, characterized in that: The system comprises: Third-party platform, used to send interface authentication API requests to user systems; The user system is used to receive the interface authentication API request and determine the API source, and match the authentication service implementation class corresponding to the API source from the pre-registered authentication service implementation classes of various categories; And, calling the matched authentication service implementation class to authenticate the interface authentication API request issued by the third-party platform; completing the authentication, and establishing interface authentication communication between the user system and the third-party platform; The third-party platform is in communication connection with the user system.
7. An electronic device, characterized in that: The electronic device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 5.