Face authentication method and apparatus
By generating an authorization code on the verification server and establishing a corresponding relationship with the face authentication results, the existing face authentication service is solved, ensuring the accuracy and reliability of the authentication results, and preventing attackers from modifying the authentication results.
Patent Information
- Application Number
- PCT/CN2024/085640
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-26
- Filing Date
- 2024-04-02
- Publication Date
- 2024-12-05
AI Technical Summary
The existing facial authentication service is insufficient security and is vulnerable to attacks. Attackers can steal authorization codes and modify authentication results.
By generating an authorization code on the verification server and establishing a correspondence relationship with the face authentication result, only the authorization code is issued to the face verification APP, even if the attacker steals the authorization code, he cannot obtain the authentication result, which improves security.
It effectively improves the security of facial authentication services, prevents attackers from modifying authentication results, and ensures the accuracy and reliability of authentication results.
Smart Images

Figure CN2024085640_05122024_PF_FP_ABST
Abstract
Description
Face authentication method and device Technical Field
[0001] One or more embodiments of this specification relate to network information technology, and more particularly, to a face authentication method and apparatus. Background Art
[0002] With the development of network technology, facial recognition is finding wider application scenarios. For example, facial recognition is used to make payments when shopping, and to log into a system or pass through a gate. Furthermore, in addition to mini-programs and third-party apps, some HTML5 pages are also integrating facial recognition. Therefore, the security of facial recognition services is crucial, but the current security of facial recognition services needs to be improved.
[0003] Therefore, a more secure face recognition method is urgently needed.
[0004] Summary of the Invention
[0005] One or more embodiments of this specification describe a face authentication method and apparatus that can improve the security of face authentication services.
[0006] According to a first aspect, a face authentication method is provided, wherein the method includes: receiving a face authentication request sent by a face verification APP in a terminal device, the face authentication request carrying face information; authenticating the face information to obtain a face authentication result; generating an authorization code; saving a first correspondence between the authorization code and the face authentication result; sending the generated authorization code to the face verification APP, so that the face verification APP sends the authorization code to a third-party APP; receiving an authentication result query request sent by a third-party server; judging whether the authentication result query request carries an authorization code, and if so, sending the face authentication result corresponding to the authorization code carried in the authentication result query request to the third-party server, so that the third-party server sends the face authentication result to the third-party APP.
[0007] In the first aspect, before receiving the facial information sent by the face verification APP in the terminal device, the method further includes: receiving an authentication authorization request from a third-party server; obtaining an authentication identifier CertifyID based on the user identity information carried in the authentication authorization request; sending the CertifyID to the third-party server; after generating the authorization code, further including: saving the second correspondence between the generated authorization code and the obtained CertifyID; the authentication result query request further carries the CertifyID; after determining that the authentication result query request carries the authorization code, and before sending the face recognition result corresponding to the authorization code to the third-party server, further including: determining whether there is the second correspondence between the CertifyID carried in the authentication result query request and the authorization code carried in the authentication result query request, if so, continuing to execute the sending of the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server, otherwise, refusing to return the face recognition result.
[0008] In the first aspect, before the facial information sent by the face verification APP in the receiving terminal device, the method further includes: receiving an authentication and authorization request from a third-party server, the authentication and authorization request carrying user identity information and the session identifier SessionID of this session, obtaining an authentication identifier CertifyID corresponding to the user identity information; and saving a third correspondence between the CertifyID and the SessionID; and sending the CertifyID to the third-party server, so that the third-party server sends the CertifyID to the third-party APP; the face authentication request sent by the face verification APP further carries: the CertifyID and SessionID reported by the third-party APP to the face authentication APP; after the face authentication request sent by the face verification APP in the receiving terminal device, and before obtaining the face authentication result, it further includes: determining whether the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request have the third correspondence; if so, continuing to execute the obtaining of the face authentication result; otherwise, the face authentication fails.
[0009] In the first aspect, after the authorization code is generated, it further includes: saving the fourth correspondence between the generated authorization code and the SessionID obtained from the authentication authorization request; after determining that the authentication result query request carries the authorization code, and before sending the face recognition result corresponding to the authorization code to the third-party server, it further includes: determining whether the authentication result query request sent by the third-party server carries the SessionID, and if so, determining whether there is the fourth correspondence between the SessionID carried in the authentication result query request and the authorization code carried in the authentication result query request, and if so, continuing to execute the sending of the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server, otherwise, refusing to return the face recognition result.
[0010] According to the second aspect, a face authentication method is provided, wherein the method includes: receiving an authentication trigger request sent by a third-party APP in a terminal device; obtaining the user's face information; carrying the face information in the face authentication request and sending it to a verification server; if an authorization code issued by the verification server is received, sending the authorization code to the third-party APP.
[0011] In the second aspect, the authentication trigger request sent by the third-party APP carries the authentication identifier CertifyID and the session identifier SessionID of this session; the facial information is carried in the face authentication request and sent to the verification server, including: carrying the facial information, the CertifyID and SessionID obtained from the authentication trigger request in the face authentication request and sending it to the verification server.
[0012] According to the third aspect, a face recognition method is provided, which includes: receiving an authentication result query request sent by a third-party APP; the authentication result query request carries an authorization code; sending the authentication result query request carrying the authorization code to a verification server; receiving a face recognition result sent by the verification server; and sending the face recognition result to the third-party APP.
[0013] In the third aspect, before receiving the authentication result query request from the third-party APP, it further includes: receiving an authentication authorization request from the third-party APP, which carries the user identity information and the session identifier SessionID of this session; sending the authentication authorization request carrying the user identity information and the SessionID to the verification server; sending the authentication result query request carrying the authorization code to the verification server includes: sending the authentication result query request carrying the authorization code and the SessionID to the verification server.
[0014] According to the fourth aspect, a face authentication method is provided, wherein the method includes: sending an authentication trigger request to a face verification APP in a terminal device to trigger the face verification APP to obtain the user's face information; receiving an authorization code sent by the face verification APP; sending an authentication result query request carrying the authorization code to a third-party server to trigger the third-party server to query the face authentication result; and receiving the face authentication result sent by the third-party server.
[0015] In the fourth aspect, before sending the authentication trigger request to the face verification APP in the terminal device, it further includes: sending an authentication authorization request to a third-party server, which carries the user identity information and the session identifier SessionID of this session; sending the authentication trigger request to the face verification APP in the terminal device includes: carrying the SessionID and the authentication identifier CertifyID sent by the third-party server in the authentication trigger request and sending it to the face verification APP in the terminal device; the authentication result query request further carries the CertifyID and / or the SessionID.
[0016] According to the fifth aspect, a face recognition device is provided, wherein the device is arranged in a verification server, and the device includes: a face recognition request receiving module, configured to receive a face recognition request sent by a face verification APP in a terminal device, and the face recognition request carries face information; a face recognition execution module, configured to authenticate the face information and obtain a face recognition result; an authentication result processing module, configured to generate an authorization code; save a first correspondence between the authorization code and the face recognition result; an authorization code issuing module, configured to issue the generated authorization code to the face verification APP, so that the face verification APP sends the authorization code to a third-party APP; a result query processing module, configured to receive an authentication result query request sent by a third-party server; determine whether the authentication result query request carries an authorization code, and if so, send the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server, so that the third-party server sends the face recognition result to the third-party APP.
[0017] According to the sixth aspect, a face authentication device is provided, wherein the device is arranged in a terminal device and is used to execute the processing of a face verification APP. The device includes: a trigger request receiving module, configured to receive an authentication trigger request sent by a third-party APP in the terminal device; a face information processing module, configured to obtain the user's face information; carry the face information in the face authentication request and send it to the verification server; an authorization code forwarding module, configured to send the authorization code to the third-party APP if the authorization code issued by the verification server is received.
[0018] According to the seventh aspect, a face recognition device is provided, which is arranged in a third-party server, and the device includes: a query request receiving module, configured to receive an authentication result query request sent by a third-party APP; the authentication result query request carries an authorization code; a query request forwarding module, configured to send the authentication result query request carrying the authorization code to the verification server; an authentication result acquisition module, configured to receive the face recognition result sent by the verification server; and send the face recognition result to the third-party APP.
[0019] According to the eighth aspect, a face authentication device is provided, which is arranged in a terminal device and is used to implement the processing of a third-party APP. The device includes: a trigger request sending module, configured to send an authentication trigger request to the face verification APP in the terminal device to trigger the face verification APP to obtain the user's face information; an authorization code receiving module, configured to receive the authorization code sent by the face verification APP; a query request sending module, configured to send an authentication result query request carrying the authorization code to a third-party server to trigger the third-party server to query the face authentication result; an authentication result determination module, configured to receive the face authentication result sent by the third-party server.
[0020] According to a ninth 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.
[0021] The face recognition method and device provided in each embodiment of this specification have at least the following beneficial effects: 1. After authenticating the face information, the verification server does not directly send the face recognition result, such as the status value indicating successful verification or the status value indicating failed verification, to the face verification APP, but instead sends the authorization code to the face verification APP. Accordingly, the face verification APP cannot send the face recognition result to a third-party APP. In this way, even if an attack occurs and the attacker steals the authorization code, the attacker cannot obtain the face recognition result based on the authorization code, and the attacker cannot modify the face recognition result. Therefore, the security of the face recognition service is greatly improved.
[0022] 2. Provide face recognition results using the first correspondence. Specifically, considering that CertifyID corresponds to the user's identity information rather than the facial information used in the authentication, CertifyID is not used as a credential for querying face recognition results in the embodiments of this specification. Instead, an authorization code that can represent the facial information during an authentication process is used as a credential for querying face recognition results. In other words, if the third-party APP and the third-party server can provide the correct authorization code to the verification server, the verification server will provide the face recognition result based on the first correspondence between the authorization code and the face recognition result that it has pre-saved.
[0023] 3. Because the face recognition result will not be sent directly to the third-party APP, but the authorization code will be sent first. The third-party APP cannot know the face recognition result based on the authorization code. Therefore, the third-party APP and the third-party server are forced to actively query the verification server for the face recognition result based on the obtained authorization code, thereby meeting the requirements of the protocol and further improving the security of the face recognition service.
[0024] 4. Utilize the third-party correspondence to address potential CertifyID leakage. Specifically, the verification server can use the pre-stored third-party correspondence between SessionID and CertifyID to determine whether the CertifyID carried in the face authentication request is legitimate and whether an attack has occurred due to CertifyID leakage. If so, the face authentication result will not be provided. This further improves the security of the face authentication process.
[0025] 5. Use the second correspondence to verify the legitimacy of the third-party server and third-party app that inquires about the face recognition result. Specifically, the verification server can pre-store the second correspondence between the authorization code and the CertifyID. If the third-party server can provide the authorization code and CertifyID with this second correspondence, the legitimacy of the third-party app and the third-party server can be confirmed, and the face recognition result can be provided.
[0026] 6. Use the fourth correspondence to verify the legitimacy of the third-party server and third-party app that inquires about the face recognition result. Specifically, the verification server can pre-store the fourth correspondence between the authorization code and the SessionID. If the third-party server can provide the authorization code and SessionID with the fourth correspondence, the legitimacy of the third-party app and the third-party server can be confirmed, and the face recognition result can be provided. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. 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 any creative work.
[0028] FIG1 is a schematic diagram of a system architecture used in an embodiment of this specification.
[0029] FIG2 is a flowchart of a face authentication method executed in a verification server in one embodiment of the present specification.
[0030] FIG3 is a flowchart of a face authentication method executed in a face verification APP in one embodiment of this specification.
[0031] FIG4 is a flowchart of a face authentication method executed in a third-party server in one embodiment of the present specification.
[0032] FIG5 is a flowchart of a face authentication method executed in a third-party APP in one embodiment of this specification.
[0033] FIG6 is a flow chart of a face recognition method performed by cooperation among various parties in one embodiment of this specification.
[0034] FIG7 is a schematic diagram of the structure of a face recognition device provided in a verification server in one embodiment of this specification.
[0035] FIG8 is a schematic diagram of the structure of a face authentication device configured in a terminal device to execute the face verification APP process in one embodiment of the present specification.
[0036] FIG9 is a schematic diagram of the structure of a face recognition device provided in a third-party server in one embodiment of this specification.
[0037] FIG10 is a schematic diagram of the structure of a face recognition device configured in a terminal device to execute third-party APP processing in one embodiment of the present specification. DETAILED DESCRIPTION
[0038] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0039] First, it should be noted that the terms used in the embodiments of this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms "a," "the," and "the" used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0040] 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.
[0041] On the terminal device side, an application, called a third-party app, needs to use the face authentication service. It will send the collected facial information to the verification server through the face authentication app on the terminal device side. The verification server will then verify the face and send the face authentication result to the third-party app through the face authentication app. However, in the process of the verification server sending the face authentication result to the face authentication app and in the process of the face authentication app sending the face authentication result to the third-party app, it is possible to be attacked, thereby changing the face authentication result. For example, if an attacker uses a fake face to initiate face authentication, although the face authentication result sent by the verification server is a failure, the attacker can modify the sent face authentication result and change it to a pass, thereby greatly reducing the security of the face authentication service.
[0042] To facilitate understanding of the methods provided in this specification, we first describe the system architecture involved and applicable to this specification. As shown in Figure 1, the system architecture mainly includes four network nodes: a third-party app, a face verification app, a third-party server, and a verification server.
[0043] The third-party app and facial verification app are installed and run on terminal devices, which may include, but are not limited to, smart mobile devices, 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.
[0044] The third-party server can be a single server or a server group consisting of multiple servers, which is responsible for providing network services for third-party apps, such as security authentication, network service level management, etc.
[0045] The verification server can be a single server or a server group consisting of multiple servers, which is responsible for providing network services for the face verification APP, such as face comparison, etc.
[0046] It should be understood that the number of third-party apps, face verification apps, third-party servers, and verification servers in FIG1 is merely illustrative, and any number may be selected and deployed as needed.
[0047] As can be seen, the method of the embodiment of the present application involves the processing of the third-party APP, the processing of the face verification APP, the processing of the third-party server, and the processing of the verification server. The following will illustrate the processing of each party in the face authentication process through different embodiments.
[0048] The following first describes the processing within the verification server. Figure 2 is a flow chart of a facial authentication method performed within the verification server, according to one embodiment of this specification. This method is performed by a facial authentication device located within the verification server. It is understood that this method can also be performed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 2, this method includes steps 201 through 215.
[0049] Step 201: The verification server receives a face authentication request sent by the face authentication APP in the terminal device, and the face authentication request carries face information.
[0050] Step 203: The verification server authenticates the facial information and obtains the facial recognition result; Step 205: The verification server generates an authorization code; Step 207: The verification server saves the first correspondence between the authorization code and the facial recognition result; Step 209: The verification server sends the generated authorization code to the facial verification APP, so that the facial verification APP sends the authorization code to the third-party APP; Step 211: The verification server receives the authentication result query request sent by the third-party server; Step 213: The verification server determines whether the authentication result query request carries an authorization code. If so, execute step 215; otherwise, refuse to provide the facial recognition result and end the current process.
[0051] Step 215: The verification server sends the face authentication result corresponding to the authorization code carried in the authentication result query request to the third-party server, so that the third-party server sends the face authentication result to the third-party APP.
[0052] The process shown in Figure 2 above describes the processing in the verification server. Corresponding to the processing of the verification server shown in Figure 2 above, the face verification app, the third-party server and the third-party app also need to cooperate to complete the corresponding processing.
[0053] The following describes the corresponding processing performed in the face verification app, corresponding to the processing in the verification server shown in Figure 2. Figure 3 is a flow chart of a face verification method performed in the face verification app, according to one embodiment of this specification. The method is performed by a face verification device. The device is located in a terminal device. It is understood that the method can also be performed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 3, the method includes steps 301 to 307.
[0054] Step 301: The face verification APP receives an authentication trigger request sent by a third-party APP in the terminal device.
[0055] Step 303: The face verification APP obtains the user's face information.
[0056] Step 305: The face verification APP carries the face information in the face authentication request and sends it to the verification server.
[0057] Step 307: If the face verification APP receives the authorization code sent by the verification server, it sends the authorization code to the third-party APP.
[0058] The following describes the corresponding processing performed on the third-party server, corresponding to the processing of the verification server shown in Figure 2. Figure 4 is a flow chart of a facial authentication method performed on a third-party server in one embodiment of this specification. The method is performed by a facial authentication device. The device is located on the third-party server. It is understood that the method can also be performed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 4, the method includes steps 401 to 407.
[0059] Step 401: The third-party server receives an authentication result query request from the third-party APP; the authentication result query request carries an authorization code.
[0060] Step 403: The third-party server sends an authentication result query request carrying the authorization code to the verification server.
[0061] Step 405: The third-party server receives the face authentication result sent by the verification server.
[0062] Step 407: The third-party server sends the face authentication result to the third-party APP.
[0063] The following describes the corresponding processing performed in the third-party app corresponding to the processing of the verification server shown in Figure 2. Figure 5 is a flowchart of the face recognition method performed in the third-party app in one embodiment of this specification. The execution subject of this method is a face recognition device. The device is located in the terminal device. It can be understood that this method can also be performed by any device, equipment, platform, or device cluster with computing and processing capabilities. Referring to Figure 5, the method includes steps 501 to 507.
[0064] Step 501: The third-party APP sends an authentication trigger request to the face verification APP in the terminal device to trigger the face verification APP to obtain the user's face information.
[0065] Step 503: The third-party APP receives the authorization code sent by the face verification APP.
[0066] Step 505: The third-party APP sends an authentication result query request carrying the authorization code to the third-party server to trigger the third-party server to query the face authentication result.
[0067] Step 507: The third-party APP receives the face authentication result sent by the third-party server.
[0068] As mentioned above, the verification server directly sends the face recognition result, such as the status value indicating successful verification or the status value indicating failed verification, to the face verification APP. Correspondingly, the face verification APP also directly sends the face recognition result to the third-party APP. When an attack occurs against the face recognition result, the face recognition result received by the face verification APP or the third-party APP will be changed. For example, if the attacker initiates face recognition using a fake face, although the face recognition result sent by the verification server is failed, the attacker can modify the sent face recognition result and change it to passed, thereby greatly reducing the security of the face recognition service. In contrast, referring to the processes shown in Figures 2 to 5 above, in the embodiments of this specification, after authenticating the facial information, the verification server does not directly send the facial authentication result, such as a status value indicating successful authentication or a status value indicating failed authentication, to the facial authentication app. Instead, it sends an authorization code to the facial authentication app. Accordingly, the facial authentication app cannot send the facial authentication result to a third-party app. In this way, even if an attack occurs and the attacker steals the authorization code, the attacker cannot obtain the facial authentication result based on the authorization code, and the attacker cannot modify the facial authentication result. Therefore, the security of the facial authentication service is greatly improved. Referring to Figures 2 to 5, subsequently, the third-party app and the third-party server can only obtain the facial authentication result if they can provide the correct authorization code to the verification server.
[0069] In order to improve security, in the face authentication service, after the third-party APP receives the face authentication result forwarded by the face authentication APP, it will also require the third-party APP and the third-party server to actively query the authentication server for the face authentication result. However, in the related art, because the third-party APP has obtained the result of whether the face authentication is successful from the face authentication result forwarded by the face authentication APP, many third-party APPs and third-party servers will not actively query the authentication server for the face authentication result as required by the protocol, thereby violating the protocol requirements and reducing the security of the face authentication service. On the contrary, referring to the process shown in Figures 2 to 5, in the embodiment of this specification, because the face authentication result is not sent directly to the third-party APP, but the authorization code is sent first, the third-party APP cannot know the face authentication result based on the authorization code. Therefore, the third-party APP and the third-party server must actively query the authentication server for the face authentication result based on the obtained authorization code, thereby complying with the protocol requirements and further improving the security of the face authentication service. In the above embodiment of this specification, the authorization code is used to prevent attackers from modifying the face authentication result.
[0070] In the embodiments of this specification, the following issues in the face authentication process are further considered: 1. When the third-party APP and the third-party server actively query the verification server for the result of face verification, how to use the authorization code to verify the legitimacy of the third-party APP and the third-party server.
[0071] 2. How to avoid security issues in facial authentication caused by the leakage of the authentication identifier (CertifyID).
[0072] Regarding the first question above, the following two methods can be used to verify the legitimacy of the third-party APP and third-party server: Method A, use the correspondence between the authorization code and the CertifyID, recorded as the second correspondence, to verify the legitimacy of the third-party APP and third-party server.
[0073] Method B: Use the correspondence between the authorization code and the session identifier (SessionID), recorded as the fourth correspondence, to verify the legitimacy of the third-party APP and the third-party server.
[0074] The following describes the above-mentioned method A.
[0075] In the face authentication business, each user's identity information, such as the user's name, uniquely corresponds to a CertifyID, that is, a CertifyID represents a user. In a session, because the user's face information needs to be authenticated, the CertifyID corresponding to the user's identity information will be transmitted between the verification server, the third-party server, the face verification APP and the third-party APP. Taking advantage of this feature, in one embodiment of this specification, the correspondence between the authorization code and the CertifyID, that is, the second correspondence, can be saved in the verification server, so that the second correspondence can be used to verify the legitimacy of the third-party APP and the third-party server.
[0076] In method A, when a third-party APP needs to use the face authentication function, it will send an authentication authorization request carrying user identity information to the third-party server before the face verification APP sends the face information. The third-party server will send the authentication authorization request carrying user identity information to the verification server, thereby exchanging the user identity information for the CertifyID. That is, the verification server receives the authentication authorization request sent by the third-party server; obtains the authentication identifier CertifyID based on the user identity information carried in the authentication authorization request; sends the CertifyID to the third-party server, and the third-party server sends the CertifyID to the third-party APP. After that, the verification server generates an authorization code; the verification server will save the second correspondence between the generated authorization code and the obtained CertifyID. Afterwards, when the face authentication result needs to be queried, the third-party APP will send an authentication result query request carrying the CertifyID and authorization code to the third-party server, and the third-party server will then send the authentication result query request carrying the CertifyID and authorization code to the verification server. In this way, in the above step 213, after the verification server determines that the authentication result query request carries the authorization code, and before sending the face authentication result corresponding to the authorization code to the third-party server, it further includes: the verification server determines whether there is a second corresponding relationship stored in the verification server between the CertifyID carried in the authentication result query request and the authorization code carried in the authentication result query request, that is, whether the corresponding relationship between the CertifyID carried in the authentication result query request and the authorization code carried in the authentication result query request can be found in the second corresponding relationship stored in the verification server. If so, it is determined that the third-party server and the third-party APP are legal, and the face authentication result corresponding to the authorization code carried in the authentication result query request is sent to the third-party server. Otherwise, it is determined that the third-party server and the third-party APP are illegal, and the face authentication result is refused to be returned.
[0077] The following first describes a method for solving the second problem mentioned above. Based on this solution, method B for solving the first problem mentioned above can be further implemented.
[0078] As mentioned above, in facial authentication, a CertifyID represents a user's identity information. Therefore, the same CertifyID is used across different facial authentications for the same user. If an attack occurs during different facial authentications and the attacker steals the user's identity information, they can obtain the CertifyID corresponding to that user's identity information. Therefore, there is still a certain risk, which can reduce the security of the facial authentication process. Using a SessionID, which identifies a session, can further mitigate this risk. This is because the SessionID not only represents the user's identity information in a facial authentication, but also the facial information in this facial authentication. Therefore, it can solve the second problem mentioned above.
[0079] At this time, when the third-party app needs to use the face authentication function, it will obtain the SessionID of this session. Before the face authentication app sends the face information, the third-party app sends an authentication and authorization request carrying the user identity information and SessionID to the third-party server. The third-party server sends the authentication and authorization request carrying the user identity information and SessionID to the verification server, thereby exchanging the user identity information for the CertifyID on the one hand, and reporting the SessionID of this session to the verification server on the other hand. In other words, the verification server receives the authentication and authorization request sent by the third-party server, which carries the user identity information and the SessionID of this session, obtains the CertifyID corresponding to the user identity information, saves the third correspondence between the CertifyID and the SessionID, and sends the CertifyID and SessionID to the third-party server, so that the third-party server can send the CertifyID and SessionID to the third-party app. Afterwards, the third-party APP will carry the obtained CertifyID and SessionID in the authentication trigger request and send it to the face verification APP in the terminal device; the APP will carry the obtained facial information, the CertifyID and SessionID obtained from the authentication trigger request in the face authentication request and send it to the verification server. After receiving the face authentication request sent by the face verification APP, and before authenticating the face to obtain the face authentication result, the verification server further includes: the verification server determines whether there is the third corresponding relationship between the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request, that is, whether the corresponding relationship between the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request can be found in the third corresponding relationship stored by the verification server itself. If so, it is determined that the CertifyID has not been stolen, and the face authentication is continued to obtain the face authentication result. Otherwise, the face authentication fails. It can be seen that this processing solves the above-mentioned problem 2. Afterwards, the verification server generates an authorization code; the verification server saves the fourth correspondence between the generated authorization code and the obtained SessionID.Afterwards, when the face authentication result needs to be queried, the third-party app will send an authentication result query request carrying the SessionID and authorization code to the third-party server. The third-party server will then send the authentication result query request carrying the SessionID and authorization code to the verification server. Thus, in step 213 above, after the verification server determines that the authentication result query request carries the authorization code, and before sending the face authentication result corresponding to the authorization code to the third-party server, the verification server further determines whether the SessionID carried in the authentication result query request and the authorization code carried in the authentication result query request have a fourth correspondence stored in the verification server. In other words, whether the correspondence between the SessionID carried in the authentication result query request and the authorization code carried in the authentication result query request can be found in the fourth correspondence stored in the verification server. If so, the third-party server and the third-party app are determined to be legitimate, and the facial authentication result corresponding to the authorization code carried in the authentication result query request is sent to the third-party server. Otherwise, the third-party server and the third-party app are determined to be illegitimate, and the facial authentication result is refused to be returned. Thus, method B for problem 1 is implemented.
[0080] FIG6 is a flow chart of a face recognition method implemented by various parties in cooperation in one embodiment of the present disclosure. Referring to FIG6 , the method includes steps 601 to 633 .
[0081] Step 601: The third-party APP obtains the SessionID and sends an authentication and authorization request carrying the sessionID and user identity information to the third-party server.
[0082] Step 603: The third-party server sends an authentication and authorization request carrying the session ID and user identity information to the verification server.
[0083] Step 605: The verification server obtains the CertifyID corresponding to the user identity information carried in the authentication and authorization request, and saves the correspondence between the obtained CertifyID and the sessionID carried in the authentication and authorization request, which is recorded as a third correspondence.
[0084] Step 607: The verification server sends the obtained CertifyID to the third-party server.
[0085] Step 609: The third-party server sends the received CertifyID to the third-party APP.
[0086] In step 609 , in order to improve security, the third-party server may send the signed CertifyID to the third-party APP.
[0087] Step 611: The third-party APP carries the SessionID and the received CertifyID in the authentication trigger request and sends it to the face verification APP in the terminal device.
[0088] Step 613: The face verification APP obtains the user's face information, and sends the face information, the CertifyID and SessionID obtained from the authentication trigger request in the face authentication request to the verification server.
[0089] Step 615: The verification server determines whether the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request have the above-mentioned third correspondence, that is, whether the correspondence between the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request can be found in the third correspondence saved by the verification server itself. If so, it is determined that the CertifyID has not been stolen and step 617 is executed. Otherwise, the face authentication fails and the current process ends.
[0090] Step 617: The verification server authenticates the facial information and obtains a facial authentication result.
[0091] Step 619: The verification server generates an authorization code, saves the corresponding relationship between the authorization code and the face authentication result, and records it as the first corresponding relationship; the verification server saves the corresponding relationship between the authorization code and the SessionID as the fourth corresponding relationship.
[0092] In step 619 , the verification server may not save the fourth corresponding relationship, but instead save the corresponding relationship between the authorization code and the CertifyID as the second corresponding relationship.
[0093] Step 621: The verification server sends the authorization code (Authcode) to the face verification APP.
[0094] Step 623: The face verification APP sends the authorization code to the third-party APP.
[0095] Step 625: The third-party APP sends the authorization code and SessionID in the authentication result query request to the third-party server.
[0096] Step 627: The third-party server sends an authentication result query request carrying the authorization code and SessionID to the verification server.
[0097] Step 629: After the verification server determines that the authentication result query request carries an authorization code, it determines whether the SessionID carried in the authentication result query request and the authorization code carried in the authentication result query request have the above-mentioned fourth correspondence stored in the verification server. If so, execute step 631; otherwise, refuse to return the face recognition result and end the current process.
[0098] It should be noted that, in the above steps 625 to 627, the authentication result query request may not carry the SessionID, but may carry the CertifyID instead. In this way, in step 629, the verification server determines whether the CertifyID carried in the authentication result query request and the authorization code carried in the authentication result query request have the above-mentioned second correspondence stored in the verification server. If so, execute step 631; otherwise, refuse to return the face recognition result and end the current process.
[0099] Step 631: The verification server obtains the face authentication result corresponding to the authorization code carried in the authentication result query request according to the first corresponding relationship, and sends the face authentication result to the third-party server.
[0100] Step 633: The third-party server sends the received facial recognition result to the third-party APP.
[0101] The embodiment of this specification also proposes a face recognition device, which is set in the verification server, see Figure 7, and the device includes: a face recognition request receiving module 701, configured to receive a face recognition request sent by a face verification APP in a terminal device, and the face recognition request carries face information; a face recognition execution module 702, configured to authenticate the face information and obtain a face recognition result; an authentication result processing module 703, configured to generate an authorization code; save the first correspondence between the authorization code and the face recognition result; an authorization code sending module 704, configured to send the generated authorization code to the face verification APP, so that the face verification APP sends the authorization code to a third-party APP; a result query processing module 705, configured to receive an authentication result query request sent by a third-party server; determine whether the authentication result query request carries an authorization code, and if so, send the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server, so that the third-party server sends the face recognition result to the third-party APP.
[0102] In one embodiment of the present specification, the face recognition device provided in the verification server shown in FIG7 further includes: a first authorization module (not shown in FIG7 ), the first authorization module being configured to receive an authentication authorization request sent by a third-party server; obtaining an authentication identifier CertifyID based on the user identity information carried in the authentication authorization request; and sending the CertifyID to the third-party server; accordingly, the authentication result processing module 703 is further configured to, after generating the authorization code, save a second correspondence between the generated authorization code and the obtained CertifyID; the authentication result query request further carries the CertifyID; accordingly, the result query processing module 705 is configured to execute: after determining that the authentication result query request carries the authorization code and before sending the face recognition result corresponding to the authorization code to the third-party server, determine whether the CertifyID carried in the authentication result query request and the authorization code carried in the authentication result query request have the second correspondence; if so, continue to execute the step of sending the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server; otherwise, refuse to return the face recognition result.
[0103] In one embodiment of the present specification, in the face recognition device set in the verification server shown in Figure 7, it further includes: a second authorization module (not shown in Figure 7), the second authorization module is configured to execute: receiving an authentication authorization request sent by a third-party server, the authentication authorization request carries the user identity information and the session identifier SessionID of this session, obtaining the authentication identifier CertifyID corresponding to the user identity information; and saving the third corresponding relationship between the CertifyID and the SessionID; and sending the CertifyID to the third-party server, so that the third-party server sends the CertifyID to the third-party server. Third-party APP; accordingly, the face authentication request received by the face authentication request receiving module 701 further carries: the CertifyID and SessionID reported by the third-party APP to the face verification APP; accordingly, the result query processing module 705 is configured to execute: after receiving the face authentication request sent by the face verification APP in the terminal device, and before obtaining the face authentication result, determine whether the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request have the third corresponding relationship, if so, continue to execute the obtaining of the face authentication result, otherwise, the face authentication fails.
[0104] In one embodiment of the present specification, when the face recognition device set in the verification server shown in Figure 7 further includes the above-mentioned second authorization module, the authentication result processing module 703 is further configured to execute: after generating the authorization code, save the fourth correspondence between the generated authorization code and the SessionID obtained from the authentication authorization request; accordingly, the result query processing module 705 is configured to execute: after determining that the authentication result query request carries the authorization code, and before sending the face recognition result corresponding to the authorization code to the third-party server, determine whether the authentication result query request sent by the third-party server carries the SessionID, and if so, determine whether the SessionID carried in the authentication result query request and the authorization code carried in the authentication result query request have the fourth correspondence, and if so, continue to execute the sending of the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server; otherwise, refuse to return the face recognition result.
[0105] One embodiment of this specification also proposes a facial authentication device, which is installed in a terminal device and is used to execute facial authentication processing by a third-party app. Referring to Figure 8, the device includes: a trigger request receiving module 801, configured to receive an authentication trigger request from a third-party app in the terminal device; a facial information processing module 802, configured to obtain the user's facial information; and transmit the facial information to the authentication server in a facial authentication request; and an authorization code forwarding module 803, configured to transmit the authorization code issued by the authentication server to the third-party app upon receiving the authorization code.
[0106] In one embodiment of the present specification, in the face authentication device set in the terminal device shown in Figure 8, the authentication trigger request received by the trigger request receiving module 801 carries the authentication identifier CertifyID and the session identifier SessionID of this session; accordingly, the face information processing module 802 is configured to carry the face information, the CertifyID and SessionID obtained from the authentication trigger request in the face authentication request and send it to the verification server.
[0107] One embodiment of this specification also proposes a face recognition device, which is set in a third-party server. See Figure 9. The device includes: a query request receiving module 901, configured to receive an authentication result query request sent by a third-party APP; the authentication result query request carries an authorization code; a query request forwarding module 902, configured to send the authentication result query request carrying the authorization code to the verification server; an authentication result acquisition module 903, configured to receive the face recognition result sent by the verification server; and send the face recognition result to the third-party APP.
[0108] In one embodiment of the present specification, the face recognition device set in the third-party server shown in Figure 9 further includes: an authorization request forwarding module (not shown in the figure), which is configured to receive an authentication authorization request sent by a third-party APP, and the authentication authorization request carries the user identity information and the session identifier SessionID of this session; sends the authentication authorization request carrying the user identity information and the SessionID to the verification server; the query request forwarding module 902 is configured to execute: sending the authentication result query request carrying the authorization code and the SessionID to the verification server.
[0109] One embodiment of this specification also proposes a face recognition device, which is set in a terminal device and is used to implement the functions of a third-party APP. Referring to Figure 10, the device includes: a trigger request sending module 1001, configured to send an authentication trigger request to the face verification APP in the terminal device to trigger the face verification APP to obtain the user's face information; an authorization code receiving module 1002, configured to receive the authorization code sent by the face verification APP; a query request sending module 1003, configured to send an authentication result query request carrying the authorization code to a third-party server to trigger the third-party server to query the face recognition result; an authentication result determination module 1004, configured to receive the face recognition result sent by the third-party server. In one embodiment of the present specification, the face recognition device set in the terminal device shown in Figure 10 further includes: an authorization request sending module (not shown in the figure), configured to send an authentication authorization request to a third-party server, and the authentication authorization request carries user identity information and the session identifier SessionID of this session; the trigger request sending module 1001 is configured to execute: the SessionID and the authentication identifier CertifyID sent by the third-party server are carried in the authentication trigger request and sent to the face verification APP in the terminal device; the authentication result query request further carries the CertifyID and / or the SessionID.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] 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.
[0114] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this application. It should be understood that the above description is only the specific implementation methods of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.
Claims
1. A face recognition method, include: Receive a face authentication request from a face authentication application APP in a terminal device, which carries face information; Authenticate the face information and obtain a face authentication result; Generate an authorization code; Save the first correspondence between the authorization code and the face authentication result; Send the generated authorization code to the face verification APP, so that the face verification APP sends the authorization code to the third-party APP; Receive the authentication result query request sent by the third-party server; Determine whether the authentication result query request carries the authorization code. If it is determined that the authentication result query request carries the authorization code, send the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server, so that the third-party server sends the face recognition result to the third-party APP.
2. The method according to claim 1, in, Before receiving the face authentication request sent by the face authentication APP in the terminal device, the method further includes: receiving an authentication authorization request sent by the third-party server; obtaining an authentication identifier CertifyID according to the user identity information carried in the authentication authorization request; and sending the CertifyID to the third-party server; After the authorization code is generated, the method further includes: saving a second corresponding relationship between the generated authorization code and the obtained CertifyID; The authentication result query request further carries the CertifyID; After determining that the authentication result query request carries the authorization code, and before sending the face recognition result corresponding to the authorization code to the third-party server, it further includes: determining whether there is the second corresponding relationship between the CertifyID carried in the authentication result query request and the authorization code carried in the authentication result query request; if there is the second corresponding relationship, continue to send the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server; if there is no second corresponding relationship, refuse to return the face recognition result.
3. The method according to claim 1, in, Before the face information sent by the face verification APP in the receiving terminal device, the method further includes: receiving an authentication authorization request sent by the third-party server, the authentication authorization request carrying the user identity information and the session identifier SessionID of this session, obtaining the authentication identifier CertifyID corresponding to the user identity information; and saving the third corresponding relationship between the CertifyID and the SessionID; and sending the CertifyID to the third-party server, so that the third-party server sends the CertifyID to the third-party APP; The face authentication request sent by the face verification APP further carries: the CertifyID and the SessionID reported by the third-party APP to the face verification APP; After receiving the face authentication request sent by the face verification APP in the receiving terminal device and before obtaining the face authentication result, it further includes: judging whether there is the third corresponding relationship between the CertifyID carried in the face authentication request and the SessionID carried in the face authentication request; if there is the third corresponding relationship, continuing to execute the obtaining of the face authentication result; if there is no third corresponding relationship, the face authentication fails.
4. The method according to claim 3, further comprising: include: Saving a fourth correspondence between the generated authorization code and the SessionID obtained from the authentication authorization request; After determining that the authentication result query request carries an authorization code and before sending the face recognition result corresponding to the authorization code to the third-party server, it further includes: determining whether the authentication result query request sent by the third-party server carries the SessionID; if it carries the SessionID, determining whether there is a fourth corresponding relationship between the SessionID carried in the authentication result query request and the authorization code carried in the authentication result query request; if there is the fourth corresponding relationship, continuing to execute the sending of the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server; if there is no fourth corresponding relationship, refusing to return the face recognition result.
5. A face recognition method, include: Receive authentication trigger requests from third-party apps in terminal devices; Get the user's facial information; The facial information is carried in a facial authentication request and sent to a verification server; If the authorization code sent by the verification server is received, the authorization code is sent to the third-party APP.
6. According to the method of claim 5, the authentication trigger request sent by the third-party APP carries the authentication identifier CertifyID and the session identifier SessionID of this session; The face information is carried in the face authentication request and sent to the verification server, include: The facial information, the CertifyID obtained from the authentication trigger request, and the SessionID are carried in the facial authentication request and sent to the verification server.
7. A face recognition method, include: Receive an authentication result query request from a third-party APP, where the authentication result query request carries an authorization code; Sending the authentication result query request carrying the authorization code to the verification server; Receiving the face authentication result sent by the verification server; The face authentication result is sent to a third-party APP.
8. The method according to claim 7, in, Before receiving the authentication result query request sent by the third-party APP, it further includes: receiving an authentication authorization request sent by the third-party APP, the authentication authorization request carrying the user identity information and the session identifier SessionID of this session; sending the authentication authorization request carrying the user identity information and the SessionID to the verification server; The sending the authentication result query request carrying the authorization code to the verification server includes: sending the authentication result query request carrying the authorization code and the SessionID to the verification server.
9. A face recognition method, include: Send an authentication trigger request to the face verification APP in the terminal device to trigger the face verification APP to obtain the user's face information; Receive the authorization code sent by the face verification APP; Sending an authentication result query request carrying the authorization code to a third-party server to trigger the third-party server to query the face authentication result; Receive the face authentication result sent by the third-party server.
10. The method according to claim 9, in, Before sending the authentication trigger request to the face verification APP in the terminal device, it further includes: sending an authentication authorization request to the third-party server, the authentication authorization request carrying the user identity information and the session identifier SessionID of this session; The sending the authentication trigger request to the face verification APP in the terminal device includes: carrying the SessionID and the authentication identifier CertifyID sent by the third-party server in the authentication trigger request and sending it to the face verification APP in the terminal device; The authentication result query request further carries the CertifyID and / or the SessionID.
11. A face recognition device, in, The device is arranged in the verification server, and comprises: A face authentication request receiving module is configured to receive a face authentication request sent by a face authentication APP in a terminal device, wherein the face authentication request carries face information; A face authentication execution module is configured to authenticate the face information and obtain a face authentication result; The authentication result processing module is configured to generate an authorization code; and save a first correspondence between the authorization code and the face authentication result; The authorization code issuing module is configured to issue the generated authorization code to the face verification APP, so that the face verification APP sends the authorization code to the third-party APP; The result query processing module is configured to receive an authentication result query request sent by a third-party server; determine whether the authentication result query request carries an authorization code, and if it is determined that the authentication result query request carries the authorization code, send the face recognition result corresponding to the authorization code carried in the authentication result query request to the third-party server, so that the third-party server sends the face recognition result to the third-party APP.
12. A face authentication device, in, The device is set in a terminal device and is used to execute the processing of the face verification APP. The device includes: A trigger request receiving module, configured to receive an authentication trigger request sent by a third-party APP in a terminal device; A face information processing module is configured to obtain the face information of the user and send the face information to the verification server by carrying it in a face authentication request; The authorization code forwarding module is configured to send the authorization code to the third-party APP if the authorization code sent by the verification server is received.
13. A face recognition device, which is set in a third-party server. include: A query request receiving module is configured to receive an authentication result query request sent by a third-party APP, wherein the authentication result query request carries an authorization code; A query request forwarding module, configured to send an authentication result query request carrying an authorization code to a verification server; The authentication result acquisition module is configured to receive the face authentication result sent by the verification server and send the face authentication result to the third-party APP.
14. A face recognition device, which is set in a terminal device and is used to implement the processing of a third-party APP. include: A trigger request sending module is configured to send an authentication trigger request to the face verification APP in the terminal device to trigger the face verification APP to obtain the user's face information; An authorization code receiving module, configured to receive the authorization code sent by the face verification APP; A query request sending module is configured to send an authentication result query request carrying the authorization code to a third-party server to trigger the third-party server to query the face authentication result; The authentication result determination module is configured to receive the face authentication result sent by the third-party server.
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 10 is implemented.
Citation Information
Patent Citations
Method, device and system for certification authorization
CN103888451A
Authentication method and system based on third-party certification authority
CN105049429A
Access resource authentication method and device and electronic equipment
CN113328971A
Face authentication method and device
CN116582338A
Secure Online Payment System And Online Payment Authentication Method
US20070288392A1
