Compatible method and device of OAuth protocol, equipment and medium
By introducing the adapter layer, the problems of code redundancy and integration complexity in the OAuth2.0 compatibility method are solved, and the application seamless interaction with the OAuth2.0 server is achieved, reducing integration complexity and improving scalability.
Patent Information
- Application Number
- CN202510630419.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-07-29
AI Technical Summary
The existing OAuth2.0 compatibility methods have problems with code redundancy and high integration complexity.
By introducing the adapter layer, multiple preset adapter components are determined, and according to the identification information and conversion protocol, the application's request and response format is converted to the OAuth2.0 server format, and the server's response is converted back to the standard format of the application, achieving seamless interaction between the application and the OAuth2.0 server.
Reduces integration complexity, enhances application scalability, reduces code redundancy, simplifies the integration process, and improves code reusability.
Smart Images

Figure CN120390041A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of authorization frameworks, and particularly to a compatibility method, device, equipment, and medium for the OAuth protocol. Background Art
[0002] OAuth2.0 is an authorization framework that allows third-party applications to access protected resources without exposing user credentials, and it is widely used in web applications, mobile applications, and desktop applications.
[0003] Existing OAuth2.0 compatibility methods generally involve the application integrating separately for each service provider or using a standardized OAuth2.0 library, etc.
[0004] However, the existing processing methods have problems such as code redundancy and high integration complexity. Summary of the Invention
[0005] This application provides a compatibility method, device, equipment, and medium for the OAuth protocol to solve the problems of code redundancy and high integration complexity existing in the existing processing methods.
[0006] In a first aspect, this application provides a compatibility method for the OAuth protocol, and the method includes:
[0007] Determine a plurality of preset adaptation components;
[0008] Determine a standard request sent by a target unit, and determine the identification information of the target unit according to the standard request;
[0009] According to the identification information, determine the corresponding target adaptation component from the preset adaptation components, and determine the target device corresponding to the identification information;
[0010] According to the target adaptation component and the standard request, determine the corresponding target request, and send the target request to the target device;
[0011] Determine the target response result of the target device;
[0012] Send the target response result to the target unit.
[0013] In some embodiments of this application, determining a plurality of preset adaptation components includes:
[0014] Determine the conversion protocols of different adaptation components;
[0015] According to the conversion protocols corresponding to each adaptation component, determine the preset adaptation components.
[0016] In some embodiments of the present application, determining a corresponding target request according to a target adaptation component and a standard request, and sending the target request to a target device includes:
[0017] Based on a feedback operation of a user on a target unit, determining an authorization identifier sent by the target device;
[0018] According to the authorization identifier and the standard request, determining the target request, and sending the target request to the target device.
[0019] In some embodiments of the present application, determining a target request according to an authorization identifier and a standard request, and sending the target request to a target device includes:
[0020] Determining a conversion protocol of a target adapter;
[0021] According to the conversion protocol, determining a conversion request corresponding to the standard request;
[0022] According to the conversion request and the authorization identifier, determining the target request, and sending the target request to the target device.
[0023] In some embodiments of the present application, determining a conversion request corresponding to a standard request according to a conversion protocol includes:
[0024] Determining a preset request format of the target device;
[0025] According to the conversion protocol and the preset request format, adjusting the request format of the standard request to obtain a conversion request.
[0026] In some embodiments of the present application, determining a target response result of a target device includes:
[0027] Determining a response result of the target device to the target request;
[0028] Determining a conversion protocol of the target adaptation component and a preset response format of the target unit;
[0029] According to the conversion protocol and the preset response format, determining a target response result corresponding to the response result, and sending the target response result to the target unit.
[0030] In some embodiments of the present application, after sending the target response result to the target unit, the method further includes:
[0031] Determining a device protocol of a new device, and determining a conversion protocol corresponding to the device protocol;
[0032] According to the conversion protocol, determining a corresponding preset adaptation component.
[0033] In a second aspect, the present application provides a compatible device for an OAuth protocol. The device includes:
[0034] A component determination module, configured to determine a plurality of preset adaptation components;
[0035] An information determination module, configured to determine a standard request sent by a target unit, and determine identification information of the target unit according to the standard request;
[0036] A device determination module, configured to determine a corresponding target adaptation component from the preset adaptation components according to the identification information, and determine a target device corresponding to the identification information;
[0037] A request sending module, configured to determine a corresponding target request according to the target adaptation component and the standard request, and send the target request to the target device;
[0038] A result determination module, configured to determine a target response result of the target device;
[0039] A result sending module, configured to send the target response result to the target unit.
[0040] In a third aspect, the present application provides a computer device, including: a processor, and a memory communicatively connected to the processor;
[0041] The memory stores computer execution instructions;
[0042] The processor executes the computer execution instructions stored in the memory to implement the method of the present application.
[0043] In a fourth aspect, the present application provides a computer-readable storage medium, in which program code is stored, and when the program code is executed by a processor, it is used to implement the method of the present application.
[0044] The OAuth protocol compatibility method, device, device and medium provided by the present application determine a plurality of preset adaptation components; determine a standard request sent by a target unit, and determine identification information of the target unit according to the standard request; according to the identification information, determine a corresponding target adaptation component from the preset adaptation components, and determine a target device corresponding to the identification information; determine a corresponding target request according to the target adaptation component and the standard request, and send the target request to the target device; determine a target response result of the target device; send the target response result to the target unit.
[0045] In this way, by introducing an adapter layer, the differences between the OAuth2 protocols of different service providers can be resolved. The application interacts with the OAuth2.0 server through the corresponding adapter. The adapter converts the format of the application's request into the format of the corresponding OAuth2.0 server according to the conversion protocol, and converts the response of the OAuth2.0 server back into the standard format corresponding to the application. The adapter is responsible for handling the protocol differences between different OAuth2.0 service providers, ensuring the normal operation of the application, reducing the complexity of integration, and enhancing the scalability of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0047] Figure 1 It is a schematic flowchart of a method for compatible with the OAuth protocol provided by an embodiment of the present application;
[0048] Figure 2 It is a schematic diagram of a method for compatible with the OAuth protocol provided by an embodiment of the present application;
[0049] Figure 3 It is a schematic flowchart of another method for compatible with the OAuth protocol provided by an embodiment of the present application;
[0050] Figure 4 It is a schematic diagram of the structure of a device for compatible with the OAuth protocol provided by an embodiment of the present application;
[0051] Figure 5 It is a block diagram of the structure of a device for executing the method for compatible with the OAuth protocol according to an embodiment of the present application.
[0052] Through the above-mentioned accompanying drawings, the clear embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter; these accompanying drawings and text descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0053] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0054] The following uses specific embodiments to elaborate in detail on the technical solution of this application and how the technical solution of this application solves the above technical problems. These several specific embodiments below can be combined with each other, and for the same or similar concepts or processes, they may not be repeated in some embodiments. The embodiments of this application will be described below in conjunction with the accompanying drawings.
[0055] Figure 1 It is a schematic flowchart of a method for compatible with the OAuth protocol provided by an embodiment of this application. As Figure 1 shown, the method for compatible with the OAuth protocol may include the following steps:
[0056] S110. Determine a plurality of preset adaptation components.
[0057] Among them, the preset adaptation components are components that are preset and used to convert requests and responses between the standard format and the OAuth server format. For example, it may include adapters. Different adapters correspond to different OAuth servers and can manage the mapping relationship between the application and the OAuth service provider.
[0058] Based on this, by determining the preset adaptation components, the corresponding adapter can be determined according to the application later, and then the protocol conversion can be performed according to the adapter.
[0059] S120. Determine the standard request sent by the target unit, and determine the identification information of the target unit according to the standard request.
[0060] Among them, the target unit is the unit that needs to access the OAuth server, and it can be an application that needs to use OAuth 2.0 authorization. For example, in actual applications, the target unit can be a food recommendation program. Users can browse the dishes of various restaurants on it. This program supports logging in and authorizing with WeChat accounts to obtain relevant user information to provide personalized services. Through OAuth 2.0 authorization, the program can securely obtain relevant information of users on WeChat, provide users with a convenient login method and personalized food services, while protecting users' privacy and account security.
[0061] The standard request is an OAuth 2.0 request in the standard format sent by the application. The identification information is used to identify and distinguish different entities (such as clients, users, service providers, etc.), and to perform identity authentication and management during the authorization and access processes. For example, it can be a token ID. The token ID (Token ID) is a unique identifier used to identify and verify the identity of users, devices, or other entities, and is usually a string composed of numbers, letters, or symbols.
[0062] Based on this, by determining the OAuth2.0 request in standard format sent by the application, the identifier included in the request is determined, so that subsequently, according to the request and identifier of the application, the corresponding adapter and OAuth server can be determined.
[0063] S130. According to the identification information, determine the corresponding target adaptation component from the preset adaptation components, and determine the target device corresponding to the identification information.
[0064] Among them, the target adaptation component is the adapter corresponding to the identifier of the application, and the target device is the OAuth server corresponding to the identifier. For example, in practical applications, the target unit can be a food recommendation program where users can browse the dishes of various restaurants. This program supports logging in and authorizing with WeChat accounts to obtain relevant user information for providing personalized services. Then the target adaptation component is the adapter corresponding to the food recommendation program, which can handle the OAuth requests of this application, and the target device is the WeChat server, which can send corresponding information according to the access request of the adapter.
[0065] Based on this, by determining the identifier in the request sent by the application, the corresponding adapter and OAuth server are identified, so that subsequently, the interaction between the application and the OAuth server can be realized according to the adapter, simplifying the integration process and ensuring the normal operation of the application under different OAuth servers.
[0066] S140. According to the target adaptation component and the standard request, determine the corresponding target request, and send the target request to the target device.
[0067] Among them, the target request is the request in the format corresponding to the OAuth server. For example, if the OAuth server is the WeChat server, the target request is the request in the format corresponding to the WeChat server.
[0068] Based on this, the adapter converts the standard OAuth2.0 request of the application into the request format of a specific service provider and sends it to the corresponding OAuth server, so that the application only needs to interact with the adapter without caring about the details of the underlying protocol, simplifying the integration process. The adapter is responsible for handling the protocol differences between different service providers and ensuring the normal operation of the application.
[0069] S150. Determine the target response result of the target device.
[0070] Among them, the target response result is the response result in the standard OAuth2.0 format.
[0071] Based on this, through the adapter, a response result that meets the format requirements of the application is determined, so as to implement the interaction between the application and the OAuth2.0 server according to the adapter, without caring about the details of the underlying protocol.
[0072] S160. Send the target response result to the target unit.
[0073] Based on this, the application interacts with different OAuth2.0 servers through the adapter. The adapter converts the requests of the application into the format required by a specific server and converts the responses of the server back to the standard format, solving the protocol differences between different service providers and ensuring the normal operation of the application.
[0074] Based on the feasible implementation manner of the above S110, the present application further provides steps for determining a plurality of preset adaptation components, including:
[0075] Determine the conversion protocols of different adaptation components;
[0076] According to the conversion protocols corresponding to each adaptation component, determine the preset adaptation components.
[0077] Among them, the conversion protocol can convert requests and responses that conform to the OAuth 2.0 general standard into the format and specifications required by a specific service provider to achieve the correct interaction protocol with the service provider; the protocol refers to the rules and agreements followed by the server and the client for communication and data exchange in a computer network.
[0078] Based on this, by determining the conversion protocols corresponding to different adapters, the preset adaptation components are determined, so as to subsequently determine the adapter corresponding to the application, and then implement the interaction with the application according to the adapter.
[0079] Based on the feasible implementation manner of the above S140, the present application further provides steps for determining a corresponding target request according to the target adaptation component and the standard request and sending the target request to the target device, including:
[0080] Based on the feedback operation of the user on the target unit, determine the authorization identifier sent by the target device;
[0081] According to the authorization identifier and the standard request, determine the target request and send the target request to the target device.
[0082] Among them, the feedback operation is the user's feedback on the request of the application program. The authorization identifier can be the authorization code sent by the OAuth server. For example, the target unit can be a food recommendation program, and the OAuth server can be the WeChat server. When the user opens the food program and clicks the WeChat login button, the program will direct the user to the WeChat authorization page. The user needs to log in to their WeChat account and confirm whether to authorize the program to access their basic information, such as nickname, avatar, region, etc. After the user confirms the authorization, WeChat will return an authorization code to the program.
[0083] Based on this, by determining the authorization identifier of the target device, obtaining the user's authorization, and the access permission of the server, the target request that meets the format of the OAuth server is determined according to the authorization identifier and the request in the standard format sent by the application program.
[0084] Based on the feasible implementation manner of the above S140, the present application further provides steps for determining the target request according to the authorization identifier and the standard request, and sending the target request to the target device, including:
[0085] Determine the conversion protocol of the target adapter;
[0086] According to the conversion protocol, determine the conversion request corresponding to the standard request;
[0087] According to the conversion request and the authorization identifier, determine the target request, and send the target request to the target device.
[0088] Among them, the conversion request is a request that meets the format of the OAuth server.
[0089] Based on this, by determining the conversion protocol of the adapter, the request in the standard format of the application program is converted into a request that meets the format of the OAuth server.
[0090] Based on the feasible implementation manner of the above S140, the present application further provides steps for determining the conversion request corresponding to the standard request according to the conversion protocol, including:
[0091] Determine the preset request format of the target device;
[0092] According to the conversion protocol and the preset request format, adjust the request format of the standard request to obtain the conversion request.
[0093] Among them, the preset request format is the format of the target request corresponding to the OAuth server.
[0094] Based on this, by determining the request format corresponding to the OAuth server, the standard request of the application is converted into a converted request that meets the format requirements of the OAuth server according to the conversion protocol, so as to solve the protocol differences between different service providers. The application only needs to interact with the middle layer and does not need to care about the details of the underlying protocol, greatly simplifying the integration process.
[0095] Please refer to Figure 2 , Figure 2 which is a schematic diagram of a method for compatible with the OAuth protocol provided by an embodiment of the present application. As Figure 2 shown, the application is an application that needs to use OAuth2.0 authorization, the middle layer is a component responsible for protocol conversion and adaptation, adapter A and adapter B are adapters for requests and responses for service providers A and B respectively, and OAuth2.0 servers A and B are different OAuth2.0 service providers; the application interacts with different OAuth2.0 servers through the middle layer. The middle layer selects a suitable adapter according to the configuration, converts the request of the application into the format required by a specific server, and converts the response of the server back to the standard format.
[0096] In some embodiments of the present application, in order to achieve the purpose of solving the differences between the OAuth2 protocols of different service providers, an adapter can be introduced, and thus the corresponding adapter can be determined according to the configuration information of the application. The application interacts with different OAuth2.0 servers through the adapter without caring about the details of the underlying protocol, simplifying the integration process. The adapter realizes converting the standard OAuth2.0 request of the application into the request format of a specific service provider and converting the response of the service provider into the standard format.
[0097] In this way, the adapter can be reused by multiple applications, reducing code redundancy. When a new service provider needs to be integrated, only a new adapter needs to be implemented without modifying the code of the application, reducing the integration complexity, improving the code reusability, enhancing the scalability, and effectively handling the protocol differences.
[0098] Figure 3 which is a flowchart of another method for compatible with the OAuth protocol provided by an embodiment of the present application. As Figure 3 shown, the method for compatible with the OAuth protocol may include the following steps:
[0099] S310. Determine a plurality of preset adaptation components.
[0100] S320. Determine the standard request sent by the target unit, and determine the identification information of the target unit according to the standard request.
[0101] S330. Determine the corresponding target adaptation component from the preset adaptation components according to the identification information, and determine the target device corresponding to the identification information.
[0102] S340. Determine the corresponding target request according to the target adaptation component and the standard request, and send the target request to the target device.
[0103] In some embodiments of the present application, the specific implementation manners of steps S310 to S340 can refer to the content in the foregoing embodiments, and will not be elaborated herein.
[0104] S350. Determine the response result of the target device to the target request, the conversion protocol of the target adaptation component, and the preset response format of the target unit.
[0105] Among them, the response result is the response of the target OAuth2.0 server to the request sent by the adapter, and contains information that meets the user's needs. For example, the OAuth2.0 server can be a WeChat server, and the target unit can be a food recommendation program. The user needs to log in to their WeChat account and confirm whether to authorize the program to access their basic information. Then the corresponding response result is the user's basic information, such as nickname, avatar, region, etc.
[0106] The preset response format is the standard OAuth2.0 format corresponding to the application program.
[0107] Based on this, the protocol formats between the application program and the OAuth2.0 server are different. Through the adapter, the protocol format conversion can be achieved, thereby realizing the information transmission between the application program and different OAuth2.0 servers and reducing the integration complexity.
[0108] S360. Determine the target response result corresponding to the response result according to the conversion protocol and the preset response format, and send the target response result to the target unit.
[0109] Based on this, by determining the conversion protocol of the adapter and the standard OAuth2.0 format corresponding to the application program, the response result of the target OAuth2.0 server is converted into the target response result that meets the requirements of the standard OAuth2.0 format through the adapter, thereby realizing the transmission between the application program and OAuth2.0 servers in different formats and enhancing the scalability.
[0110] S370. Send the target response result to the target unit.
[0111] In some embodiments of the present application, the specific implementation manner of step S370 can refer to the content in the foregoing embodiments, and will not be elaborated herein.
[0112] Based on the feasible implementation manners of S370 above, the present application further provides steps that the method further includes after sending a target response result to a target unit:
[0113] Determine the device protocol of the newly added device, and determine the corresponding conversion protocol for the device protocol;
[0114] Determine the corresponding preset adaptation component according to the conversion protocol.
[0115] Wherein, the newly added device is a newly added OAuth2.0 server to be integrated, and the device protocol is the protocol corresponding to the server to be newly added.
[0116] Based on this, when it is necessary to integrate a new OAuth2.0 server, only the corresponding adapter needs to be determined, and there is no need to modify the code of the application program. Through the adapter, the transmission between the application program and the OAuth2.0 server can be realized, and the adapter can be reused by multiple application programs.
[0117] In some embodiments of the present application, by determining the protocol formats corresponding to the application program and the OAuth2.0 server respectively, the conversion of protocols in different formats can be realized through the adapter. The protocol corresponding to the OAuth2.0 server can meet the personalized requirements of different servers. At the same time, when it is necessary to add a new OAuth2.0 server, only the corresponding adapter needs to be determined, and there is no need to modify the code of the application program. The application program does not need to maintain a large amount of integration code, reducing the development and maintenance costs, simplifying the integration process, and reducing code redundancy.
[0118] Figure 4 It is a schematic structural diagram of a compatible device 400 for an OAuth protocol provided by an embodiment of the present application. As Figure 4 shown, the compatible device 400 for the OAuth protocol includes: a component determination module 410, an information determination module 420, a device determination module 430, a request sending module 440, a result determination module 450, and a result sending module 460.
[0119] The component determination module 410 is used to determine a plurality of preset adaptation components;
[0120] The information determination module 420 is used to determine a standard request sent by the target unit, and determine the identification information of the target unit according to the standard request;
[0121] The device determination module 430 is used to determine the corresponding target adaptation component from the preset adaptation components according to the identification information, and determine the target device corresponding to the identification information;
[0122] The request sending module 440 is used to determine a corresponding target request according to the target adaptation component and the standard request, and send the target request to the target device;
[0123] A result determination module 450, configured to determine a target response result of the target device;
[0124] A result sending module 460, configured to send the target response result to the target unit.
[0125] In an embodiment of the present application, the component determination module 410 may further be specifically configured to:
[0126] Determine the conversion protocols of different adaptation components;
[0127] Determine a preset adaptation component according to the conversion protocols corresponding to the respective adaptation components.
[0128] In an embodiment of the present application, the request sending module 440 may further be specifically configured to:
[0129] Determine an authorization identifier sent by the target device based on a feedback operation of the user on the target unit;
[0130] Determine a target request according to the authorization identifier and a standard request, and send the target request to the target device.
[0131] In an embodiment of the present application, the request sending module 440 may further be specifically configured to:
[0132] Determine the conversion protocol of the target adapter;
[0133] Determine a conversion request corresponding to the standard request according to the conversion protocol;
[0134] Determine a target request according to the conversion request and the authorization identifier, and send the target request to the target device. [[ID=T36]]
[0135] In an embodiment of the present application, the request sending module 440 may further be specifically configured to:
[0136] Determine a preset request format of the target device;
[0137] Adjust the request format of the standard request according to the conversion protocol and the preset request format to obtain a conversion request.
[0138] In an embodiment of the present application, the result determination module 450 may further be specifically configured to:
[0139] Determine a response result of the target device to the target request, a conversion protocol of the target adaptation component, and a preset response format of the target unit;
[0140] Determine a target response result corresponding to the response result according to the conversion protocol and the preset response format, and send the target response result to the target unit.
[0141] In an embodiment of the present application, the OAuth protocol compatibility device 400 may specifically be further configured to:
[0142] Determine the device protocol of the newly added device, and determine the corresponding conversion protocol for the device protocol;
[0143] Determine the corresponding preset adaptation component according to the conversion protocol.
[0144] Figure 5 It is a schematic structural diagram of the device provided in the embodiment of the present application. As Figure 5 shown, the device 500 includes:
[0145] The device 500 may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a communication component 503, and other components. Among them, the processor 501, the memory 502, and the communication component 503 are connected through a bus 504.
[0146] In a specific implementation process, at least one processor 501 executes the computer execution instructions stored in the memory 502, so that at least one processor 501 executes the above-mentioned OAuth protocol compatibility method.
[0147] For the specific implementation process of the processor 501, reference may be made to the above method embodiment, and its implementation principle and technical effect are similar, so they will not be elaborated here in this embodiment.
[0148] Further, the processor may be a central processing unit (English: Central Processing Unit, abbreviated as: CPU), and may also be other general-purpose processors, digital signal processors (English: Digital Signal Processor, abbreviated as: DSP), application specific integrated circuits (English: Application Specific Integrated Circuit, abbreviated as: ASIC), etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in combination with the present application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0149] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0150] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.
[0151] In some embodiments, a computer program product is also proposed, including a computer program or instruction, which when executed by a processor implements the steps in any of the above OAuth protocol compatibility methods.
[0152] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.
[0153] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0154] Therefore, an embodiment of this application provides a computer-readable storage medium, in which multiple program codes are stored, and the program codes can be loaded by a processor to execute the steps in any of the OAuth protocol compatibility methods provided by the embodiments of this application.
[0155] Among them, the storage medium can include: a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disc, etc.
[0156] According to one aspect of this application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
[0157] Since the instructions stored in the storage medium can execute the steps in any of the OAuth protocol compatibility methods provided by the embodiments of this application, the beneficial effects that can be achieved by any of the OAuth protocol compatibility methods provided by the embodiments of this application can be realized. For details, refer to the previous embodiments and will not be elaborated here.
[0158] Other embodiments of the present application will be readily apparent to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and examples are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the above-mentioned claims.
[0159] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A compatibility method for the OAuth protocol, characterized in that, The method includes: Determine a plurality of preset adaptation components; Determine a standard request sent by a target unit, and determine identification information of the target unit according to the standard request; According to the identification information, determine a corresponding target adaptation component from the preset adaptation components, and determine a target device corresponding to the identification information; According to the target adaptation component and the standard request, determine a corresponding target request, and send the target request to the target device; Determine a target response result of the target device; Send the target response result to the target unit.
2. The method according to claim 1, wherein The determining a plurality of preset adaptation components includes: Determine conversion protocols of different adaptation components; According to the conversion protocols corresponding to the respective adaptation components, determine the preset adaptation components.
3. The method according to claim 1, characterized in that, The according to the target adaptation component and the standard request, determine a corresponding target request, and send the target request to the target device includes: Based on a feedback operation of a user on the target unit, determine an authorization identifier sent by the target device; According to the authorization identifier and the standard request, determine the target request, and send the target request to the target device.
4. The method according to claim 3, wherein The according to the authorization identifier and the standard request, determine the target request, and send the target request to the target device includes: Determine a conversion protocol of the target adapter; According to the conversion protocol, determine a conversion request corresponding to the standard request; According to the conversion request and the authorization identifier, determine the target request, and send the target request to the target device.
5. The method according to claim 4, wherein The according to the conversion protocol, determine a conversion request corresponding to the standard request includes: Determine a preset request format of the target device; According to the conversion protocol and the preset request format, adjust a request format of the standard request to obtain the conversion request.
6. The method according to claim 1, wherein The determining a target response result of the target device includes: Determine a response result of the target device to the target request, a conversion protocol of the target adaptation component, and a preset response format of the target unit; According to the conversion protocol and the preset response format, determine the target response result corresponding to the response result, and send the target response result to the target unit.
7. The method according to claim 1, wherein After sending the target response result to the target unit, the method further includes: Determine a device protocol of a new device, and determine a conversion protocol corresponding to the device protocol; According to the conversion protocol, determine a corresponding preset adaptation component.
8. A compatible device for the OAuth protocol, characterized in that The apparatus includes: A component determination module, configured to determine a plurality of preset adaptation components; An information determination module, configured to determine a standard request sent by a target unit, and determine identification information of the target unit according to the standard request; A device determination module, configured to determine a corresponding target adaptation component from the preset adaptation components according to the identification information, and determine a target device corresponding to the identification information; A request sending module, configured to determine a corresponding target request according to the target adaptation component and the standard request, and send the target request to the target device; A result determination module, configured to determine a target response result of the target device; A result sending module, configured to send the target response result to the target unit.
9. A device, characterized in that, Comprising: One or more processors; A memory; One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Program code is stored in a computer-readable storage medium, and the program code can be called by a processor to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Message sending method and device, gateway and storage medium
CN112153071A
Identity verification method and device, electronic equipment and storage medium
CN113127821A
Authorized login method and device, electronic equipment and storage medium
CN115361216A
Cross-system communication method and device
CN119603328A
Multi-device interconnection method and control system
CN119865348A
Cited By
Method and device for realizing cross-system token access, equipment and storage medium
CN120768565A