Service providing method and apparatus for third-party applet

By using the verification mechanism of the application key AppKey during the provision of third-party applet services, the client consistency of initial login and resource requests is ensured, and the problem of the misappropriation of third-party applet service resources is solved, which significantly improves security.

WO2024234936A1PCT designated stage expired Publication Date: 2024-11-21ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/089076
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-18
Filing Date
2024-04-22
Publication Date
2024-11-21

AI Technical Summary

Technical Problem

In the prior art, service resources of third-party mini-programs are easily stolen, resulting in reduced security.

Method used

By generating and saving the application key AppKey and verifying its consistency during the login and resource request phases, ensuring that the initial login third-party client is the same as the client requesting the subsequent resource, thereby preventing resource data leakage.

Benefits of technology

It realizes more complete verification of the identity of third-party client, improves the security of the third-party mini-program service provision process, and prevents resource data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024089076_21112024_PF_FP_ABST
    Figure CN2024089076_21112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present description are a service providing method and apparatus for a third-party applet. The method comprises: a second-party server generating and saving an application key (AppKey), and issuing the AppKey to a first-party client; acquiring an open authentication system identifier (OpenID) and generating a session identifier (SessionID); establishing a correspondence between the AppKey, OpenID and SessionID; receiving a service data request sent by the first-party client; determining whether the SessionID and the AppKey carried in the service data request conform to the established correspondence; if so, sending to a third-party server a service resource request carrying a service parameter and the OpenID corresponding to the SessionID carried in the service data request; and sending response data to the first-party client. The embodiments of the present description can improve the service security of a third-party applet.
Need to check novelty before this filing date? Find Prior Art

Description

Third-party app service provision method and device Technical Field

[0001] One or more embodiments of this specification relate to network communication technology, and more particularly, to a method and apparatus for providing services for third-party applets. Background Art

[0002] With the continuous advancement of software development technology, mini-programs (mini programs) have gradually come into the public eye due to their speed and portability. Mini-programs are applications that can be used without downloading or installing. As third-party software, mini-programs generally run within a host program, which provides the mini-program with a service interface that enables various business functions. For example, there are currently mini-programs for Alipay, 360, and Toutiao.

[0003] When providing services to third-party mini-programs, the following network nodes are usually involved: a third-party client (i.e., an application loaded on a terminal device by a third-party mini-program), a third-party server (i.e., a server providing services to the third-party mini-program), a second-party server, a first-party client (i.e., an application loaded on a terminal device by a host program), and a first-party server (i.e., a server providing services to the host program). The first-party server stores the user's original user ID. To prevent privacy leaks of the original user ID, the second-party server stores the OpenID mapped from the original user ID. When providing services to third-party mini-programs, the original user ID is no longer used. Instead, the OpenID is used as the user's identifier, and the service for the third-party mini-program is completed through processing by the second-party server.

[0004] However, in related technologies, it often happens that the service resources enjoyed by third-party applets are stolen, which greatly reduces security.

[0005] Summary of the Invention

[0006] One or more embodiments of this specification describe a method and apparatus for providing services of a third-party mini-program, which can improve the security of the services of the third-party mini-program.

[0007] According to a first aspect, a service provision method for a third-party mini-program is provided, the method comprising: a service provision method for a third-party mini-program, the method comprising: generating and saving an application key AppKey; issuing the AppKey to a first-party client, so that the first-party client issues the AppKey to the third-party client; obtaining an open authentication system identifier OpenID and generating a session identifier SessionID; establishing a correspondence between the AppKey, OpenID and SessionID; receiving a business data request from the first-party client, the business data request carrying the SessionID, AppKey and business parameters; judging whether the SessionID and AppKey carried in the business data request conform to the established correspondence; if so, sending a business resource request to a third-party server, the business resource request carrying the business parameters and the OpenID corresponding to the SessionID carried in the business data request; sending response data returned by the third-party server to the first-party client, so that the first-party client sends the response data to the third-party client.

[0008] According to the second aspect, a service provision method for a third-party mini-program is provided, which includes: receiving an AppKey sent by a first-party client; sending a third-party login request to the first-party client; after receiving a successful login response from the first-party client, sending a business data request to the first-party client, wherein the business data request carries the AppKey and business parameters; and receiving response data sent by the first-party client.

[0009] According to the third aspect, a service provision method for a third-party mini program is provided, which includes: receiving an AppKey sent by a second-party server; sending the AppKey to a third-party client; sending a third-party login request sent by the third-party client to the second-party server; receiving a session identifier SessionID sent by the second-party server, and sending a login success response to the third-party client; receiving a business data request sent by the third-party client, which carries the AppKey and business parameters; sending the business data request carrying the SessionID, AppKey and business parameters to the second-party server; receiving response data sent by the second-party server, and sending the response data to the third-party client.

[0010] According to the fourth aspect, a service providing device for a third-party mini-program is provided, which includes: an application key processing module, configured to generate and save an application key AppKey, and send the AppKey to a first-party client; an identification acquisition module, configured to obtain an open authentication system identification OpenID and generate a session identification SessionID; a correspondence establishment module, configured to establish a correspondence between the AppKey, OpenID and SessionID; a business processing module, configured to receive a business data request from the first-party client, the business data request carrying the SessionID, AppKey and business parameters; and determine whether the SessionID and AppKey carried in the business data request conform to the established correspondence; a resource acquisition module, configured to send a business resource request to a third-party server after the business processing module determines that the correspondence is conformed; the business resource request carries the business parameters and the OpenID corresponding to the SessionID carried in the business request; a response data processing module, configured to send the response data returned by the third-party server to the first-party client, so that the first-party client sends the response data to the third-party client.

[0011] According to the fifth aspect, a service providing device for a third-party mini-program is provided, which includes: an application key acquisition module, configured to receive an AppKey sent by a first-party client; a login request module, configured to send a third-party login request to the first-party client; a resource request module, configured to send a business data request to the first-party client after receiving a successful login response from the first-party client, wherein the business data request carries the AppKey and business parameters; and a resource data receiving module, configured to receive response data sent by the first-party client.

[0012] According to the sixth aspect, a service providing device for a third-party applet is provided, which includes: an AppKey forwarding module, configured to receive an AppKey sent by a second-party server; send the AppKey to a third-party client; a login processing module, configured to send a third-party login request sent by the third-party client to the second-party server; receive a session identifier SessionID sent by the second-party server, and send a login success response to the third-party client; a business data request forwarding module, configured to receive a business data request sent by a third-party client, the business data request carrying AppKey and business parameters; send the business data request carrying SessionID, AppKey and business parameters to the second-party server; a response data forwarding module, configured to receive response data sent by the second-party server, and send the response data to the third-party client.

[0013] According to a seventh aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in any embodiment of this specification is implemented.

[0014] In order to prevent the service resources enjoyed by third-party mini-programs from being misappropriated, it is necessary to ensure that the third-party client that initially logs in and connects is the same third-party client that subsequently requests resources. Therefore, in the service provision method and device for third-party mini-programs provided in the embodiments of this specification, in the first stage, i.e., the stage when the third-party client initiates the login, the second-party server will send the AppKey to the third-party client through the first-party client, so that the third-party client that initiates the login obtains the AppKey information. After that, in the second stage, when the third-party client requests resource data, the second-party server obtains the AppKey from the current third-party client from the business data request. If the AppKey obtained by the second-party server in the second stage is the same as the AppKey issued by the second-party server in the first stage, it means that the third-party client that initiated the login in the first stage and the third-party client that obtained the resource data in the second stage are the same client, and resource data leakage will not occur. Therefore, the response data will be sent to the third-party client requesting resource data through the first-party client. If the AppKey obtained by the second-party server in the second stage is different from the AppKey issued by the second-party server in the first stage, it means that the third-party client that initiated the login in the first stage and the third-party client that obtained the resource data in the second stage are not the same client. If the response data is provided, resource data leakage will occur. Therefore, the response data will not be sent to the third-party client requesting resource data through the first-party client. It can be seen that the method of the embodiment of this specification completes a more complete verification process for the identity of the third-party client, greatly improving the security of the service provision process of the third-party applet. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of this specification or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0016] FIG1 is a schematic diagram of a system architecture used in an embodiment of this specification.

[0017] FIG2 is a flowchart of a service provision method of a third-party applet executed in a second-party server in one embodiment of the present specification.

[0018] FIG3 is a flowchart of a service provision method of a third-party applet executed in a third-party client in one embodiment of the present specification.

[0019] FIG4 is a flowchart of a service provision method of a third-party applet executed in a first-party client in one embodiment of the present specification.

[0020] FIG5 is a flowchart of a method for providing services of a third-party applet executed in cooperation among various parties in one embodiment of this specification.

[0021] FIG6 is a schematic diagram of the structure of a service providing device for a third-party applet set in a second-party server in one embodiment of the present specification.

[0022] FIG7 is a schematic diagram of the structure of a service providing device for a third-party applet provided in a third-party client in one embodiment of the present specification.

[0023] FIG8 is a schematic diagram of the structure of a service providing device for a third-party applet provided in a first-party client in one embodiment of the present specification. DETAILED DESCRIPTION

[0024] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0025] First, it should be noted that the terms used in the embodiments of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. As used in the embodiments of the present invention and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise.

[0026] It should be understood that the term "and / or" as used herein is merely a description of the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0027] In order to facilitate the understanding of the method provided in this specification, the system architecture involved and applicable to this specification is first described. As shown in Figure 1, the system architecture mainly includes five types of network nodes: a third-party client (i.e., the application end of the third-party applet loaded on the terminal device), a third-party server (i.e., the server that provides service resources for the third-party applet), a second-party server (for security reasons, used to isolate the first-party server from the third-party server), a first-party client (i.e., the application end of the host program loaded on the terminal device), and a first-party server (i.e., the server that provides services for the host program).

[0028] Both third-party clients and first-party clients are installed and run on terminal devices. Terminal devices may include, but are not limited to, smart mobile terminals, smart home devices, network devices, wearable devices, smart medical devices, and PCs (personal computers). Smart mobile devices may include mobile phones, tablets, laptops, PDAs (personal digital assistants), and internet-connected cars. Smart home devices may include smart home appliances such as smart TVs, smart air conditioners, smart water heaters, smart refrigerators, and smart air purifiers. Smart home devices may also include smart door locks, smart sockets, smart lights, and smart cameras. Network devices may include switches, wireless access points, and servers. Wearable devices may include smart watches, smart glasses, smart bracelets, virtual reality devices, augmented reality devices, and mixed reality devices (i.e., devices that support both virtual reality and augmented reality). Smart medical devices may include smart thermometers, smart blood pressure monitors, and smart blood glucose meters.

[0029] It should be understood that the number of various network nodes in FIG1 is merely illustrative and any number may be selected and deployed according to implementation requirements.

[0030] The methods of the embodiments of this specification mainly involve the processing of the second-party server, the processing of the third-party client, and the processing of the first-party client, which are described below through different embodiments.

[0031] First, the processing in the second-party server is described. Figure 2 is a flow chart of a method for providing a service for a third-party mini-program executed in a second-party server in one embodiment of this specification. The execution subject of this method is a service providing device for the third-party mini-program. This device can be located in the second-party server. It is understood that this method can also be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 2, the method includes steps 201 to 217.

[0032] Step 201: The second-party server generates and saves the application key (AppKey); Step 203: The second-party server sends the AppKey to the first-party client, so that the first-party client can send the AppKey to the third-party client; Step 205: The second-party server obtains the open authentication system identifier (OpenID) and generates a session identifier (SessionID); Step 207: The second-party server establishes a correspondence between the AppKey, OpenID and SessionID; Step 209: The second-party server receives the business data request sent by the first-party client, and the business data request carries the SessionID, AppKey and business parameters; Step 211: The second-party server determines whether the SessionID and AppKey carried in the business data request conform to the established correspondence; if so, execute step 215, otherwise execute step 213.

[0033] Step 213: Refuse to provide services to the current third-party client, and end the current process.

[0034] Step 215: The second-party server sends a business resource request to the third-party server, where the business resource request carries the business parameters and the OpenID corresponding to the SessionID carried in the business data request. Step 217: The second-party server sends the response data returned by the third-party server to the first-party client, so that the first-party client sends the response data to the third-party client.

[0035] The process shown in Figure 2 above describes the processing in the second-party server. Corresponding to the processing of the second-party server shown in Figure 2 above, the third-party client and the first-party client also need to cooperate to complete the corresponding processing.

[0036] The following describes the corresponding processing performed in the third-party client corresponding to the processing of the second-party server shown in Figure 2. Figure 3 is a flowchart of the service provision method of the third-party applet executed in the third-party client in one embodiment of this specification. The execution subject of the method is the service provision device of the third-party applet. The device can be located in the third-party client. It can be understood that the method can also be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 3, the method includes: step 301: the third-party client receives the AppKey sent by the first-party client; step 303: the third-party client sends a third-party login request to the first-party client; step 305: after receiving the successful login response sent by the first-party client, the third-party client sends a business data request to the first-party client, and the business data request carries the AppKey and business parameters; step 307: the third-party client receives the response data sent by the first-party client.

[0037] The following describes the corresponding processing performed in the first-party client corresponding to the processing of the second-party server shown in Figure 2. Figure 4 is a flow chart of a service provision method for a third-party mini-program executed in a first-party client in one embodiment of this specification. The execution subject of this method is a service provision device for the third-party mini-program. The device can be located in the first-party client. It is understood that this method can also be performed by any device, equipment, platform, or device cluster with computing and processing capabilities. 4 , the method includes: step 401: the first-party client receives the AppKey sent by the second-party server; step 403: the first-party client sends the AppKey to the third-party client; step 405: the first-party client sends the third-party login request sent by the third-party client to the second-party server; step 407: the first-party client receives the session identifier SessionID sent by the second-party server, and sends a login success response to the third-party client; step 409: the first-party client receives the business data request sent by the third-party client, and the business data request carries the AppKey and business parameters; step 411: the first-party client sends the business data request carrying the SessionID, AppKey and business parameters to the second-party server; step 413: the first-party client receives the response data sent by the second-party server, and sends the response data to the third-party client.

[0038] As mentioned above, in the relevant technologies, it often happens that the service resources enjoyed by third-party applets are misappropriated, thus greatly reducing security. For example, on a host program platform, there are multiple third-party applet clients (i.e., multiple third-party clients), and these multiple third-party applet clients all obtain the service resources they need through the same host program (i.e., the same first-party client). Therefore, it is very likely that third-party client A obtains the SessionID of a session that originally belonged to third-party client B, thereby allowing third-party client A to obtain the service resources that should have been provided to third-party client B. For another example, an attacker can also obtain the service resources that should have been provided to third-party client B by launching an attack. Therefore, the security of the relevant technologies needs to be improved.

[0039] In the embodiments of this specification, in order to prevent the service resources enjoyed by the third-party mini-program from being misappropriated, it is necessary to ensure that the third-party client that initially logs in and connects is the same client that subsequently requests resources. Therefore, referring to the processes shown in Figures 2, 3, and 4 above, in the method of the embodiments of this specification, in the first stage, i.e., the stage when the third-party client initiates the login, the second-party server will send the AppKey to the third-party client through the first-party client, so that the third-party client that initiates the login obtains the AppKey information. After that, in the second stage, when the third-party client requests resource data, the second-party server obtains the AppKey from the current third-party client from the business data request. If the AppKey obtained by the second-party server in the second stage is the same as the AppKey issued by the second-party server in the first stage, it means that the third-party client that initiated the login in the first stage and the third-party client that obtained the resource data in the second stage are the same client, and resource data leakage will not occur. Therefore, the response data will be sent to the third-party client requesting resource data through the first-party client. If the AppKey obtained by the second-party server in the second stage is different from the AppKey issued by the second-party server in the first stage, it means that the third-party client that initiated the login in the first stage and the third-party client that obtained the resource data in the second stage are not the same client. If the response data is provided, resource data leakage will occur. Therefore, the response data will not be sent to the third-party client requesting resource data through the first-party client. It can be seen that the method of the embodiment of this specification completes a more complete verification process for the identity of the third-party client, greatly improving the security of the service provision process of the third-party applet.

[0040] In the process shown in Figures 2, 3, and 4 above, the third-party client obtains the AppKey issued by the second-party server in the first stage. Specifically, in the third-party client, the process before step 301 includes: in the first stage when the third-party client requests to log in, the third-party client sends the initialization key pre-agreed with the second-party server to the first-party client; accordingly, in the first-party client, the process before step 401 further includes: the first-party client sends the initialization key sent by the third-party client to the second-party server; accordingly, in the second-party server, the process before step 201 further includes: the second-party server receives the initialization key pre-agreed with the third-party client forwarded by the first-party client; verifies the initialization key; if the verification is successful, executes the step 201 to generate and save the AppKey.

[0041] In the process shown in Figures 2, 3, and 4 above, the SessionID can be further encrypted, so that the encrypted SessionID is transmitted among the parties, further preventing other parties from misappropriating the SessionID of the third-party client in the session and stealing the service resources of the third-party client in the session. Specifically, in the second-party server, after generating the SessionID in step 205 and before receiving the service data request from the first-party client in step 209, the process further includes: the second-party server encrypts the SessionID using the AppKey and sends the encrypted SessionID to the first-party client; accordingly, the first-party client sends the encrypted SessionID to the third-party client; accordingly, the third-party client decrypts the SessionID using the AppKey and sends the SessionID to the first-party client, and the first-party client caches the SessionID.

[0042] In the embodiments of this specification, the service parameters can be further encrypted for transmission to further improve security. Specifically, the second-party server, after generating the SessionID in step 205 and before receiving the service data request from the first-party client in step 209, further comprises: generating a session key, which has the same lifecycle as the SessionID; sending the session key and the SessionID to the first-party client;

[0043] Afterwards, in the first-party client, the first-party client receives the session key sent by the second-party server and saves the session key; in step 411, before sending the business data request to the second-party server, it further includes: the first-party client uses the saved session key to encrypt the business parameters in the business data request sent to the second-party server; that is, the business data request sent by the first-party client to the second-party server carries the business parameters encrypted using the session key; thereafter, in the second-party server, after determining in step 211 that the SessionID and AppKey carried in the business data request meet the established correspondence, before the second-party server sends the business resource request to the third-party server, the second-party server uses the session key to decrypt the encrypted business parameters in the business data request to obtain the business parameters, so that the business parameters can be carried in the business resource request in step 215.

[0044] The following is a flowchart of the service provision method of a third-party mini-program in the embodiment of this specification, using the cooperation of various parties in the system shown in Figure 1. Referring to Figure 5 , the method includes steps 501 to 545 .

[0045] Step 501: When a business service corresponding to a third-party client is needed, the third-party client sends an initialization key agreed in advance with the second-party server to the first-party client.

[0046] Step 503: The first-party client sends the initialization key to the second-party server.

[0047] Step 505: The second-party server verifies the received initialization key and generates an AppKey after successful verification.

[0048] Step 507: The second-party server sends the AppKey to the first-party client, and the first-party client sends the AppKey to the third-party client.

[0049] Step 509: The third-party client sends a third-party login request to the first-party client. The third-party login request is used to request to establish a session connection for the third-party client, and the third-party login request carries the AppKey and the identity information of the third-party client.

[0050] For example, a third-party client corresponds to a third-party mini-program on the Alipay platform that processes user electricity bills. A first-party client corresponds to the host program on the Alipay platform. When a user needs to check their electricity bill balance, they can click on the third-party mini-program, which then sends a third-party login request to the first-party client through the corresponding third-party client.

[0051] Step 511: The first-party client sends the received third-party login request to the second-party server.

[0052] Step 513: The second-party server obtains the AppKey from the third-party login request and verifies the AppKey, that is, determines whether the AppKey carried in the third-party login request is the same as the previously generated AppKey. If they are the same, execute step 515; otherwise, refuse to provide services to the current third-party client and end the current process.

[0053] Step 515: The second-party server sends the identity information of the third-party client and a session update request in a one-party login state to the first-party server.

[0054] Step 517: The first-party server returns a token corresponding to this session to the second-party server, and saves the consistency relationship between the token and the received login state.

[0055] Step 519: The second-party server uses the token and the login status of one party to request OpenID from the first-party server.

[0056] Step 521: The first-party server verifies whether the token used when requesting the OpenID and the login state of one party have the above consistency relationship. If so, it returns the OpenID corresponding to this session to the second-party server.

[0057] Step 523: The second-party server generates a SessionID and a session key based on the received OpenID, encrypts the SessionID and the session key using the AppKey, and establishes a correspondence between the obtained AppKey, OpenID, and SessionID.

[0058] Step 525: The second-party server sends the encrypted SessionID and session key to the first-party client.

[0059] Step 527: The first-party client sends the encrypted SessionID and session key to the third-party client.

[0060] Step 529: The third-party client uses the AppKey to decrypt the encrypted SessionID and session key to obtain the SessionID and session key.

[0061] Step 531: The third-party client sends the decrypted SessionID and session key to the first-party client.

[0062] Step 533: The first-party client saves the SessionID and session key, and sends a login success response to the third-party client.

[0063] Step 535: After receiving the successful login response from the first-party client, the third-party client sends a service data request to the first-party client. The service data request carries the AppKey and service parameters.

[0064] Step 537: The first-party client encrypts the service parameters using the session key, and sends a service data request carrying the SessionID, AppKey, and the encrypted service parameters to the second-party server.

[0065] Step 539: The second-party server verifies the AppKey, that is, determines whether the SessionID and AppKey carried in the business data request conform to the established correspondence. If so, execute step 541; otherwise, refuse to provide services to the current third-party client.

[0066] Step 541: The second-party server decrypts the encrypted service parameters using the session key, and then sends a service resource request to the third-party server. The service resource request carries the service parameters and the OpenID corresponding to the SessionID in the service data request.

[0067] Step 543: The second-party server sends the response data returned by the third-party server to the first-party client.

[0068] Step 545: The first-party client sends the response data to the third-party client.

[0069] In one embodiment of the present specification, a service providing device for a third-party applet is provided, and the device is set in a second-party server. 6 , the apparatus includes: an application key processing module 601 configured to generate and store an application key AppKey and send the AppKey to a first-party client; an identifier acquisition module 602 configured to obtain an open authentication system identifier OpenID and generate a session identifier SessionID; a correspondence establishment module 603 configured to establish a correspondence between the AppKey, OpenID, and SessionID; a business processing module 604 configured to receive a business data request from the first-party client, the business data request carrying the SessionID, AppKey, and business parameters; and determine whether the SessionID and AppKey carried in the business data request conform to the established correspondence; a resource acquisition module 605 configured to, after the business processing module determines that the correspondence conforms, send a business resource request to a third-party server, the business resource request carrying the business parameters and the OpenID corresponding to the SessionID carried in the business request; and a response data processing module 606 configured to send response data returned by the third-party server to the first-party client, so that the first-party client can send the response data to the third-party client.

[0070] In one embodiment of the device of this specification shown in Figure 6, the application key processing module 601 is further configured to: before generating and saving the application key AppKey, receive the initialization key pre-agreed with the third-party client forwarded by the first-party client; verify the initialization key; if the verification is successful, execute the generation and saving of AppKey.

[0071] In one embodiment of the device of this specification shown in Figure 6, the above-mentioned business processing module 604 is further configured to: after generating the SessionID and before receiving the business data request sent by the first-party client, further use the AppKey to encrypt the SessionID, and send the encrypted SessionID to the first-party client, so that the first-party client interacts with the third-party client so that the first-party client obtains the decrypted SessionID.

[0072] In one embodiment of the device of this specification shown in Figure 6, the above-mentioned business processing module 604 is further configured to: after generating the SessionID and before receiving the business data request sent by the first-party client, further generate a session key, and the session key has the same life cycle as the SessionID; send the session key and the SessionID to the first-party client; in the business data request sent by the first-party client, the business parameters are encrypted by the first-party client using the session key; after determining that the SessionID and AppKey carried in the business data request meet the established correspondence, and before sending the business resource request to the third-party server, further use the session key to decrypt the encrypted business parameters in the business data request to obtain the business parameters.

[0073] In one embodiment of the present specification, a service provision device for a third-party mini-program is provided, which is disposed in a third-party client. Referring to Figure 7 , the device includes: an application key acquisition module 701 configured to receive an AppKey sent by a first-party client; a login request module 702 configured to send a third-party login request to the first-party client; a resource request module 703 configured to, upon receiving a successful login response from the first-party client, send a service data request to the first-party client, the service data request carrying the AppKey and service parameters; and a resource data receiving module 704 configured to receive response data from the first-party client.

[0074] In the embodiment of the apparatus of this specification shown in FIG7 , the application key acquisition module 701 is further configured to execute: before receiving the AppKey sent by the first-party client, send the initialization key pre-agreed with the second-party server to the first-party client.

[0075] In the embodiment of the device of this specification shown in Figure 7, the login request module 702 is further configured to execute: receiving the encrypted SessionID and session key sent by the first-party client; using the AppKey to decrypt the encrypted SessionID and session key to obtain the SessionID and session key; and sending the decrypted SessionID and session key to the first-party client.

[0076] In one embodiment of the present specification, a service provision device for a third-party mini-program is provided, which is disposed in a first-party client. Referring to FIG8 , the device includes: an AppKey forwarding module 801 configured to receive an AppKey from a second-party server and send the AppKey to the third-party client; a login processing module 802 configured to send a third-party login request from the third-party client to the second-party server; receive a session identifier SessionID from the second-party server and send a successful login response to the third-party client; a service data request forwarding module 803 configured to receive a service data request from the third-party client, the service data request carrying the AppKey and service parameters; and send the service data request carrying the SessionID, AppKey, and service parameters to the second-party server; and a response data forwarding module 804 configured to receive response data from the second-party server and send the response data to the third-party client.

[0077] In the embodiment of the apparatus of this specification shown in FIG8 , the AppKey forwarding module 801 is further configured to execute: before receiving the AppKey sent by the second-party server, sending the initialization key sent by the third-party client to the second-party server.

[0078] In the embodiment of the device of this specification shown in Figure 8, the SessionID sent by the second-party server received by the login processing module 802 is an encrypted SessionID, and the encrypted SessionID is further sent to the third-party client; and the decrypted SessionID sent by the third-party client is received.

[0079] In the embodiment of the device of this specification shown in Figure 8, the login processing module 802 receives the encrypted SessionID and session key sent by the second-party server, and sends the encrypted SessionID and session key to the third-party client; receives the decrypted SessionID and session key sent by the third-party client; the business data request forwarding module 803 sends the business data request to the second-party server, which carries the business parameters encrypted using the session key.

[0080] One embodiment of the present specification provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute the method in any one of the embodiments of the present specification.

[0081] An embodiment of the present specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of any embodiment of the present specification is implemented.

[0082] It should be understood that the structures illustrated in the embodiments of this specification do not constitute specific limitations on the devices of the embodiments of this specification. In other embodiments of the specification, the above-mentioned devices may include more or fewer components than shown in the figure, or combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0083] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0084] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented using hardware, software, widgets, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0085] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for providing services of a third-party mini program, the method comprising: Generate and save the application key AppKey; Send the AppKey to the first-party client, so that the first-party client can send the AppKey to the third-party client; Obtain an open authentication system identifier OpenID and generate a session identifier SessionID; Establishing a corresponding relationship between the AppKey, OpenID and SessionID; Receive a service data request from the first-party client, where the service data request carries the SessionID, AppKey, and service parameters; Determine whether the SessionID and AppKey carried in the business data request conform to the established corresponding relationship; If yes, send a service resource request to the third-party server, where the service resource request carries the service parameters and the OpenID corresponding to the SessionID carried in the service data request; The response data returned by the third-party server is sent to the first-party client, so that the first-party client sends the response data to the third-party client.

2. The method according to claim 1, wherein: Before generating and saving the application key AppKey, the method further includes: Receiving an initialization key forwarded by the first-party client and pre-agreed with the third-party client; Verifying the initialization key; If the verification is successful, the AppKey is generated and saved.

3. The method according to claim 1, wherein: After generating the SessionID and before receiving the service data request sent by the first-party client, the method further includes: The SessionID is encrypted using the AppKey, and the encrypted SessionID is sent to the first-party client, so that the first-party client interacts with the third-party client so that the first-party client obtains the decrypted SessionID.

4. The method according to claim 1, wherein: After generating the SessionID and before receiving the service data request from the first-party client, the method further includes: generating a session key, the session key having the same life cycle as the SessionID; sending the session key and the SessionID to the first-party client; In the service data request sent by the first-party client, the service parameter is encrypted by the first-party client using a session key; After determining that the SessionID and AppKey carried in the service data request conform to the established corresponding relationship, and before sending the service resource request to the third-party server, further comprising: using the session key to The encrypted service parameters in the data request are decrypted to obtain the service parameters.

5. A method for providing services of a third-party mini program, the method comprising: Receive the AppKey sent by the first-party client; Send a third-party login request to the first-party client; After receiving a successful login response from the first-party client, sending a service data request to the first-party client, the service data request carries the AppKey and service parameters; Receive response data sent by the first-party client.

6. The method according to claim 5, wherein: Before the AppKey sent by the first-party client is received, the third-party client sends an initialization key pre-agreed with the second-party server to the first-party client.

7. The method according to claim 5, wherein: After sending the third-party login request to the first-party client and before sending the service data request to the first-party client, further comprising: receiving the encrypted SessionID and session key sent by the first-party client; decrypting the encrypted SessionID and session key using the AppKey to obtain the SessionID and session key; Correspondingly, after obtaining the SessionID and the session key, the method further includes: sending the decrypted SessionID and the session key to the first party client.

8. A method for providing services of a third-party mini program, the method comprising: Receive the AppKey sent by the second-party server; Send the AppKey to the third-party client; Sending the third-party login request sent by the third-party client to the second-party server; Receive the session identifier SessionID sent by the second-party server and send a login success response to the third-party client; Receive business data requests from third-party clients, which carry AppKey and business parameters; Send the business data request carrying SessionID, AppKey and business parameters to the second-party server; Receive response data from the second-party server, and send the response data to the third-party client.

9. The method according to claim 8, wherein: Before receiving the AppKey sent by the second-party server, the method further includes: the first-party client sends the initialization key sent by the third-party client to the second-party server.

10. The method according to claim 8, wherein: The SessionID sent by the second-party server is an encrypted SessionID, so the encrypted SessionID is sent to the third-party client; After sending the encrypted SessionID to the third-party client, Before the business data request is made, the process further includes: receiving a decrypted SessionID sent by a third-party client.

11. The method according to claim 8, wherein: The receiving of the session identifier SessionID sent by the second party server includes: the first party client receives the encrypted SessionID and session key sent by the second party server, and sends the encrypted SessionID and session key to the third party client; After sending the encrypted SessionID and session key to the third-party client and before receiving the service data request sent by the third-party client, the method further includes: the first-party client receiving the decrypted SessionID and session key sent by the third-party client; Then, the service data request sent by the first-party client to the second-party server carries the service parameters encrypted using the session key.

12. A service providing device for a third-party applet, the device comprising: An application key processing module, configured to generate and save an application key AppKey, and send the AppKey to the first-party client; The identification acquisition module is configured to obtain the open authentication system identification OpenID and generate a session identification SessionID; A corresponding relationship establishing module, configured to establish a corresponding relationship between the AppKey, OpenID and SessionID; The business processing module is configured to receive a business data request sent by a first-party client, the business data request carrying the SessionID, AppKey and business parameters; and determine whether the SessionID and AppKey carried in the business data request conform to the established corresponding relationship; A resource acquisition module, configured to send a service resource request to a third-party server after the service processing module determines that the corresponding relationship is met, wherein the service resource request carries the service parameters and an OpenID corresponding to the SessionID carried in the service request; The response data processing module is configured to send the response data returned by the third-party server to the first-party client, so that the first-party client sends the response data to the third-party client.

13. A service providing device for a third-party applet, the device comprising: An application key acquisition module, configured to receive the AppKey sent by the first-party client; a login request module configured to send a third-party login request to a first-party client; A resource request module, configured to send a service data request to the first-party client after receiving a successful login response from the first-party client, wherein the service data request carries the AppKey and service parameters; The resource data receiving module is configured to receive response data sent by the first-party client.

14. A service providing device for a third-party applet, the device comprising: An AppKey forwarding module configured to receive the AppKey sent by the second-party server; Send the AppKey to Third-party clients; A login processing module configured to send a third-party login request sent by a third-party client to a second-party server; Receive the session identifier SessionID sent by the second-party server and send a login success response to the third-party client; The business data request forwarding module is configured to receive a business data request from a third-party client, the business data request carrying the AppKey and business parameters; and send the business data request carrying the SessionID, AppKey and business parameters to the second-party server; The response data forwarding module is configured to receive the response data sent by the second-party server and send the response data to the third-party client.

15. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Login method and device applied to applet end

    CN112039826A

  • Small program package sending method and device, electronic equipment and computer readable medium

    CN112148345A

  • Key negotiation method and device for applet application

    CN116032556A

  • Service providing method and device for third-party applet

    CN116545720A

  • Cryptographic binding of native application and external browser sessions

    US20230017382A1