Information authentication method and device, computer equipment, readable storage medium and program product
By acquiring and performing dual-factor authentication at the terminal and building updated authentication information when necessary, the problem of low efficiency of traditional information authentication is solved, and a more efficient user login process is achieved.
Patent Information
- Application Number
- CN202411715662.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-28
AI Technical Summary
In traditional information authentication technology, single session authentication method leads to low information authentication efficiency, especially when the shared storage space is replaced, the identifier needs to be re-established.
By obtaining the first login identifier and the second login identifier at the terminal, the first authentication and the second authentication are performed respectively. If the first authentication fails but the second authentication is successful, the first updated authentication information is constructed to replace the original identifier.
It improves the efficiency of information authentication, avoids the invalid verification process caused by storage space replacement, and ensures the continuity and stability of user login.
Smart Images

Figure CN119544230A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information authentication method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of computer technology, information authentication technology has emerged, which can authenticate the user's login information based on authentication session technology to complete the interaction between the server and the terminal.
[0003] In traditional technology, a single session authentication method is generally used for information authentication. When a user logs in for the first time, a unique identifier is sent to the terminal, and the identifier is stored in a shared storage space with other servers using session authentication. Each time the user logs in, the identifier is verified with the identifier in the shared storage space. However, once the shared storage space is replaced, the identifier verification process will definitely be invalid, and a new identifier must be re-established, resulting in low information authentication efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide an information authentication method, apparatus, computer device, computer-readable storage medium and computer program product that can improve the efficiency of information authentication in response to the above technical problems.
[0005] In a first aspect, the present application provides an information authentication method, comprising:
[0006] In response to a login event initiated by a user based on a terminal, a first login identifier and a second login identifier of the user are obtained from the terminal; the first login identifier is a login identifier corresponding to a first authentication method; the second login identifier is a login identifier corresponding to a second authentication method;
[0007] Reading first authentication information corresponding to the first login identifier from the storage space, and authenticating the first authentication information according to the first authentication method to obtain a first authentication result;
[0008] Authenticate the second login identifier according to the second authentication method to obtain a second authentication result;
[0009] When the first authentication result is a failure and the second authentication result is a success, first updated authentication information for the first login identifier is constructed based on the second login identifier; the first updated authentication information is used to authenticate the first login identifier.
[0010] In one embodiment, the method further comprises:
[0011] In response to a login identification request event initiated by a user based on a terminal, sending a login authentication instruction to the terminal;
[0012] In response to a login registration event initiated by the terminal based on the login authentication instruction, acquiring the login registration information of the user from the terminal;
[0013] A first login identifier of the user corresponding to a first authentication method and a second login identifier of the user corresponding to a second authentication method are extracted from the login registration information.
[0014] In one embodiment, authenticating the first authentication information according to the first authentication method to obtain a first authentication result includes:
[0015] Reading a plurality of registered first information from the storage space;
[0016] If the first authentication information successfully matches any of the registered first information, determining that the first authentication result is successful;
[0017] If the first authentication information fails to match each of the registered first information, it is determined that the first authentication result is a failure.
[0018] In one embodiment, the method further comprises:
[0019] If the first authentication result is successful, obtaining multiple candidate login identifiers from the storage space, and determining the candidate matching degree between the first authentication information and each of the candidate login identifiers;
[0020] In the case that there is a target matching degree that satisfies the matching condition among the candidate matching degrees, the candidate login identifier corresponding to the target matching degree is deleted from the storage space.
[0021] In one embodiment, authenticating the second login identifier according to the second authentication method to obtain a second authentication result includes:
[0022] Parsing the second login identifier to obtain second identification information corresponding to the second login identifier; the second identification information includes header information, payload information and signature information;
[0023] Encrypting the header information and the payload information based on an encryption algorithm corresponding to the second authentication method to obtain encrypted information;
[0024] If the encrypted information is consistent with the signature information, determining that the second authentication result is successful;
[0025] If the encrypted information is inconsistent with the signature information, it is determined that the second authentication result is a failure.
[0026] In one embodiment, constructing first update authentication information corresponding to the first login identifier based on the second login identifier includes:
[0027] Filtering associated information associated with the load information from the storage space;
[0028] Based on the payload information and the associated information of the payload information, first updated authentication information for the first login identifier is constructed.
[0029] In a second aspect, the present application also provides an information authentication device, including:
[0030] A login identification acquisition module, configured to acquire a first login identification and a second login identification of the user from the terminal in response to a login event initiated by the user based on the terminal; the first login identification is a login identification corresponding to the first authentication method; the second login identification is a login identification corresponding to the second authentication method;
[0031] A first authentication module, configured to read first authentication information corresponding to the first login identifier from a storage space, and authenticate the first authentication information according to the first authentication method to obtain a first authentication result;
[0032] A second authentication module, used to authenticate the second login identifier according to the second authentication method to obtain a second authentication result;
[0033] An information construction module is used to construct first updated authentication information for the first login identifier based on the second login identifier when the first authentication result is failure and the second authentication result is success; the first updated authentication information is used to authenticate the first login identifier.
[0034] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0036] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0037] The above-mentioned information authentication method, apparatus, computer equipment, computer-readable storage medium and computer program product, in response to a login event initiated by a user based on a terminal, obtains the user's first login identifier and second login identifier from the terminal, and can determine the user's login identifier status, wherein the first login identifier is a login identifier corresponding to the first authentication method, and the second login identifier is a login identifier corresponding to the second authentication method, reads the first authentication information corresponding to the first login identifier from the storage space, and authenticates the first authentication information according to the first authentication method to obtain a first authentication result, and authenticates the second login identifier according to the second authentication method to obtain a second authentication result. When the first authentication result is a failure and the second authentication result is a success, it indicates that the user has been registered before and can be successfully authenticated through the second authentication result, that is, the storage space in the first authentication method is replaced, then, the server can construct a first updated authentication information for the first login identifier based on the second login identifier, wherein the first updated authentication information is used to authenticate the first login identifier, that is, other servers can directly obtain the first updated authentication information to authenticate the user's login event, thereby improving the efficiency of information authentication. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 An application environment diagram of an information authentication method in an embodiment;
[0040] Figure 2 A schematic diagram of a flow chart of an information authentication method in an embodiment;
[0041] Figure 3 is a schematic diagram of a process flow of a first authentication method in an embodiment;
[0042] Figure 4 is a schematic diagram of a flow chart of a second authentication method in an embodiment;
[0043] Figure 5 A schematic diagram of a hybrid authentication process in one embodiment;
[0044] Figure 6 is a flow chart of an information authentication method in another embodiment;
[0045] Figure 7 is a structural block diagram of an information authentication device in an embodiment;
[0046] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0048] The information authentication method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. Specifically, during the process of information authentication, server 104 obtains the user's first login identifier and second login identifier from the terminal in response to a login event initiated by the user based on the terminal; the first login identifier is the login identifier corresponding to the first authentication method; the second login identifier is the login identifier corresponding to the second authentication method; the first authentication information corresponding to the first login identifier is read from the storage space, and the first authentication information is authenticated according to the first authentication method to obtain a first authentication result; the second login identifier is authenticated according to the second authentication method to obtain a second authentication result; when the first authentication result is a failure and the second authentication result is a success, first updated authentication information for the first login identifier is constructed based on the second login identifier; the first updated authentication information is used to authenticate the first login identifier.
[0049] In an exemplary embodiment, Figure 2 As shown, an information authentication method is provided, which is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps S202 to S208. Among them:
[0050] Step S202: in response to a login event initiated by the user based on the terminal, obtaining a first login identifier and a second login identifier of the user from the terminal.
[0051] Among them, the login event refers to the login account event initiated by the user based on the terminal, for example, it can be an event in which the user enters the account and password to log in at the terminal. The first login identifier is the login identifier corresponding to the first authentication method. In this embodiment, the first login identifier refers to the Session ID. The first authentication method, in this embodiment, refers to the session authentication method. The second login identifier is the login identifier corresponding to the second authentication method. In this embodiment, the second login identifier refers to the token. The second authentication method, in this embodiment, refers to the jwt (JSON Web Token) authentication method.
[0052] Specifically, after the user initiates a login event based on the terminal, the server needs to obtain the user's first login identifier and the second login identifier from the terminal, so as to subsequently authenticate the first login identifier and the second login identifier according to the first authentication method and the second authentication method, respectively. Exemplarily, the operation of obtaining the user's first login identifier and the second login identifier from the terminal can be active acquisition or passive reception.
[0053] Step S204, reading first authentication information corresponding to the first login identifier from the storage space, and authenticating the first authentication information according to the first authentication method to obtain a first authentication result.
[0054] The storage space refers to any physical or virtual medium that can store data. In this embodiment, the storage space includes the remaining data storage space and the redis storage space in the first authentication method. The first authentication information refers to the information associated with the login authentication, for example, it may include the user ID, registration time, user authority, etc.
[0055] Specifically, when a user registers for the first time, the server will generate a first login identifier and send it to the terminal. Each subsequent authentication of the terminal will carry the first login identifier for authentication. After obtaining the first login identifier, the server can read the first authentication information corresponding to the first login identifier from the storage space, and authenticate the first authentication information according to the first authentication method to obtain the first authentication result. It can be understood that the server can determine whether the first authentication information is valid, and then determine the first authentication result. If the first authentication information is valid, the first authentication result is successful; if the first authentication information is invalid, the first authentication result is failed.
[0056] Step S206: authenticating the second login identifier according to the second authentication method to obtain a second authentication result.
[0057] Specifically, the server may perform encryption verification on the second login identifier according to the second authentication method. If the verification is successful, the second authentication result is success; if the verification fails, the second authentication result is failure.
[0058] Step S208: when the first authentication result is a failure and the second authentication result is a success, construct first updated authentication information for the first login identifier based on the second login identifier.
[0059] The first updated authentication information is used to authenticate the first login identifier.
[0060] Specifically, if the first authentication result is a failure and the second authentication result is a success, it indicates that the user's login authentication can be successfully authenticated through the second authentication method, that is, the Redis storage space corresponding to the first authentication method has been replaced. In order to ensure the normal interaction between other servers and terminals that share the storage space, the server can construct the first updated authentication information for the first login identifier based on the second login identifier, and store the first updated authentication information in the Redis storage space. Exemplarily, the server can search for other information related to the user identifier from other storage spaces based on the information related to the user identifier in the second login identifier, and together form the first updated authentication information.
[0061] The above-mentioned information authentication method, in response to a login event initiated by the user based on the terminal, obtains the user's first login identifier and second login identifier from the terminal, and can determine the user's login identifier status, wherein the first login identifier is the login identifier corresponding to the first authentication method, and the second login identifier is the login identifier corresponding to the second authentication method, reads the first authentication information corresponding to the first login identifier from the storage space, and authenticates the first authentication information according to the first authentication method to obtain the first authentication result, and authenticates the second login identifier according to the second authentication method to obtain the second authentication result. When the first authentication result is a failure and the second authentication result is a success, it indicates that the user has been registered before and can be successfully authenticated through the second authentication result, that is, the storage space in the first authentication method is replaced, then, the server can construct a first updated authentication information for the first login identifier based on the second login identifier, wherein the first updated authentication information is used to authenticate the first login identifier, that is, other servers can directly obtain the first updated authentication information to authenticate the user's login event, thereby improving the efficiency of information authentication.
[0062] In an exemplary embodiment, the information authentication method also includes: in response to a login identification request event initiated by the user based on the terminal, sending a login authentication instruction to the terminal; in response to a login registration event initiated by the terminal based on the login authentication instruction, obtaining the user's login registration information from the terminal; and extracting the user's first login identification corresponding to the first authentication method and the user's second login identification corresponding to the second authentication method from the login registration information.
[0063] The login identification request event refers to a login identification request event initiated by a user, that is, a registration event. The login authentication instruction refers to an instruction sent by a server to a terminal to instruct the terminal to perform login authentication. The login registration event is an event initiated by a terminal to register and log in. The login registration information includes the information entered by the user for login registration, and information related to the user login registration, for example, the login registration information may include the account, password, registration time, and other information entered by the user.
[0064] Specifically, the user needs to register when logging in for the first time, that is, based on a login identification request event initiated by the terminal, the server needs to send a login authentication instruction to the terminal, and in response to a login registration event initiated by the terminal based on the login authentication instruction, obtain the user's login registration information from the terminal. Since the login registration information contains relevant information about the user registration, the server can extract the user's first login identification corresponding to the first authentication method and the user's second login identification corresponding to the second authentication method from the login registration information.
[0065] In this embodiment, when the user logs in for the first time, the server will obtain the user's login registration information, and extract the user's first login identifier corresponding to the first authentication method and the user's second login identifier corresponding to the second authentication method from the login registration information, to ensure the normal progress of subsequent user login processes.
[0066] In an exemplary embodiment, first authentication information is authenticated according to a first authentication method to obtain a first authentication result, including: reading multiple registered first information from a storage space; if the first authentication information successfully matches any registered first information, determining the first authentication result to be successful; if the first authentication information fails to match each registered first information, determining the first authentication result to be a failure.
[0067] The registered first information refers to the first authentication information that has been registered in the storage space.
[0068] Specifically, all registered first authentication information in the storage space can be obtained. If the first authentication information successfully matches any registered first information, the first authentication result is determined to be successful, that is, the storage space has not been replaced; if the first authentication information fails to match each registered first information, the first authentication result is determined to be a failure, that is, the storage space has been replaced.
[0069] In this embodiment, the first authentication result is determined by the matching degree between the first information registered in the storage space and the first authentication information, so that the accuracy of the first authentication result can be guaranteed.
[0070] In an exemplary embodiment, the information authentication method also includes: if the first authentication result is successful, obtaining multiple candidate login identifiers from the storage space, and determining the candidate matching degree between the first authentication information and each candidate login identifier; when there is a target matching degree that meets the matching conditions among each candidate matching degree, deleting the candidate login identifier corresponding to the target matching degree from the storage space.
[0071] The candidate login identifier refers to a login identifier that may be selected. In this embodiment, it refers to other login identifiers in the storage space. The candidate matching degree refers to the matching degree between the candidate login identifier and the first authentication information. The matching condition is pre-set, for example, the matching condition can be 100%, 99%, etc.
[0072] Specifically, since multiple servers can share storage space, and after a user logs in and registers in an application corresponding to one of the servers, if he logs in and registers in an application corresponding to another server and then logs in again in the application corresponding to the first server, he needs to log in and register again. In other words, when the first authentication result is successful, the server needs to obtain multiple candidate login identifiers from the storage space and determine the candidate matching degree between the first authentication information and each candidate login identifier. When there is a target matching degree among the candidate matching degrees that meets the matching conditions, it indicates that there is a candidate login identifier corresponding to the user in the storage space. Therefore, the candidate login identifier corresponding to the target matching degree needs to be deleted from the storage space to ensure the security of the information authentication process.
[0073] In an exemplary embodiment, a second login identifier is authenticated according to a second authentication method to obtain a second authentication result, including: parsing the second login identifier to obtain second identification information corresponding to the second login identifier; the second identification information includes header information, payload information and signature information; based on an encryption algorithm corresponding to the second authentication method, the header information and payload information are encrypted to obtain encrypted information; if the encrypted information is consistent with the signature information, the second authentication result is determined to be successful; if the encrypted information is inconsistent with the signature information, the second authentication result is determined to be a failure.
[0074] Among them, the header information (Header): contains the type of token (i.e. JWT) and the signature algorithm used (such as HMAC SHA256 or RSA). For example: {"alg": "HS256", "typ": "JWT"}. The header information will be Base64Url encoded to form the first part of the JWT. Payload information (Payload): Contains user information and other metadata. For example: {"userId": 123456, "username": "john.doe", "role": "admin"}. The payload information will also be Base64Url encoded to form the second part of the JWT. The payload can contain claims, which are statements about entities (usually users) and other data. Note that you should not put confidential information in the payload of the JWT unless it is encrypted. Signature information (Signature): It is a signature generated by encrypting the header, payload, and key, which is used to verify the integrity and authenticity of the token. The signature is usually encrypted with a key, such as using the HMAC-SHA256 encryption algorithm. The signature part is obtained by encrypting the Base64-encoded header and payload using a hash algorithm.
[0075] Specifically, the server can parse the second login identifier to obtain the header information, payload information and signature information corresponding to the second login identifier, and then encrypt the header information and payload information based on the encryption algorithm corresponding to the second authentication method to obtain encrypted information. Since the signature information is a signature generated by encrypting the header, payload and key, if the encrypted information is consistent with the signature information, the second authentication result is determined to be successful; if the encrypted information is inconsistent with the signature information, the second authentication result is determined to be failed.
[0076] In this embodiment, the second login identifier is parsed and the obtained second identifier information is encrypted and verified, which can ensure the accuracy of the second authentication result.
[0077] In an exemplary embodiment, first updated authentication information corresponding to the first login identifier is constructed based on the second login identifier, including: filtering associated information associated with the payload information from the storage space; and constructing the first updated authentication information for the first login identifier based on the payload information and the associated information of the payload information.
[0078] Since the payload information includes user information and other metadata, the associated information associated with the payload information is other associated information related to the user.
[0079] Specifically, when user information and other metadata are known, associated information associated with the payload information can be filtered from the storage space to obtain all relevant information associated with the user. Then, based on the payload information and the associated information of the payload information, the first updated authentication information for the first login identifier can be constructed, which can facilitate the normal interaction process between other servers and terminals and improve the efficiency of information authentication.
[0080] In a specific embodiment, an information authentication method implemented in an actual application scenario is also provided:
[0081] Specifically, the algorithm generally provides three authentication methods: pseudo-session method, jwt authentication method, and mixed authentication method.
[0082] 1. Pseudo session authentication method: such as Figure 3 As shown, each system has multiple apps, and multiple apps have multiple nodes. The logged-in session information (first authentication information) is stored in redis to achieve a sharing effect. Once a user logs in, the session information can be obtained on each system and node.
[0083] 2. Jwt authentication method: such as Figure 4 As shown in the figure, after the user logs in, the server generates a jwttoken and responds to the terminal. Each time the terminal requests a header, it will carry the corresponding jwttoken, and the backend server will verify its legitimacy to determine if it is a legitimate logged-in user.
[0084] 3. Mixed authentication method: Figure 5 As shown, two authentication methods are combined, session authentication or jwt authentication. Any user who passes the authentication is considered a legitimate user.
[0085] The biggest difference is that when the App only has jwt authentication information, if the user needs to obtain session information, the pure jwt authentication app will simulate a session (update the authentication information first) and return it to the specific place of use.
[0086] Mixed authentication method steps:
[0087] First, the user who has not logged in accesses the specific application from the front end to check whether the first login identifier exists. If not, check whether the second login identifier exists and check whether the login information exists. If not, return the front end 0006 error code;
[0088] When the front end receives the 0006 error code, it redirects to the login page, and the user enters the login registration information and clicks login;
[0089] After successful authentication, try to remove the relevant information of the previous user login (do not allow the previous user to access normally), write the session-id in the cookie, and synchronously write a token with a very short validity period to the cookie;
[0090] Try to eliminate two scenarios:
[0091] If it is a session, the corresponding session-id in the login information table will be searched and removed from the session;
[0092] If it is jwt, the login timestamp will be updated synchronously. After the user visits the page, if the token timestamp is found to be earlier than the current record time, the token authentication will be invalid.
[0093] After the user's front-end responds, it will jump to the corresponding business page. The first time the page requests the back-end service, it will generate a halojwttoken with a validity period of 30 minutes through the token and respond to the header.
[0094] When redis is switching, there must be session inconsistency. At this time, session verification fails, but jwt verification passes, allowing normal access. When the backend microservice obtains the session through the standard api, since the session is invalid, a session will be built through the user information of jwttoken (first update the authentication information) and stored in the current jvm or redis (depending on whether the current system is in pure jwt mode, pure jwt will be stored in the current jvm);
[0095] When the user logs out, the session will be deleted and the halojwttoken will be stored in redis, which is valid for 30 minutes. Every time the user logs in, it will check whether it exists in the banned list. If it exists, access will not be allowed.
[0096] In a specific embodiment, Figure 6 As shown, an information authentication method is also provided, including:
[0097] Step S601, in response to a login identification request event initiated by a user based on a terminal, sending a login authentication instruction to the terminal;
[0098] Step S602, in response to a login registration event initiated by the terminal based on the login authentication instruction, obtaining the user's login registration information from the terminal;
[0099] Step S603, extracting a first login identifier of the user corresponding to the first authentication method and a second login identifier of the user corresponding to the second authentication method from the login registration information;
[0100] Step S604, in response to a login event initiated by the user based on the terminal, obtaining a first login identifier and a second login identifier of the user from the terminal;
[0101] The first login identifier is a login identifier corresponding to the first authentication method; the second login identifier is a login identifier corresponding to the second authentication method;
[0102] Step S605, reading the first authentication information corresponding to the first login identifier from the storage space, and reading a plurality of registered first information from the storage space;
[0103] Step S606, if the first authentication information successfully matches any registered first information, the first authentication result is determined to be successful, multiple candidate login identifiers are obtained from the storage space, and the candidate matching degree between the first authentication information and each candidate login identifier is determined;
[0104] Step S607, when there is a target matching degree that satisfies the matching condition among the candidate matching degrees, the candidate login identifier corresponding to the target matching degree is deleted from the storage space;
[0105] Step S608, if the first authentication information fails to match with each registered first information, determining that the first authentication result is a failure;
[0106] Step S609, parsing the second login identifier to obtain second identifier information corresponding to the second login identifier;
[0107] The second identification information includes header information, payload information and signature information;
[0108] Step S610, encrypting the header information and the payload information based on the encryption algorithm corresponding to the second authentication method to obtain encrypted information;
[0109] Step S611, if the encrypted information is consistent with the signature information, then the second authentication result is determined to be successful;
[0110] Step S612: if the encrypted information is inconsistent with the signature information, determining that the second authentication result is a failure;
[0111] Step S613, when the first authentication result is failure and the second authentication result is success, filtering the associated information associated with the payload information from the storage space;
[0112] Step S614, constructing first updated authentication information for the first login identifier based on the payload information and associated information of the payload information;
[0113] The first updated authentication information is used to authenticate the first login identifier.
[0114] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0115] Based on the same inventive concept, the embodiment of the present application also provides an information authentication device for implementing the above-mentioned information authentication method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in one or more information authentication device embodiments provided below can refer to the limitations on the information authentication method above, and will not be repeated here.
[0116] In an exemplary embodiment, Figure 7 As shown, an information authentication device 700 is provided, comprising: a login identification acquisition module 702, a first authentication module 704, a second authentication module 706 and an information construction module 708, wherein:
[0117] The login identification acquisition module 702 is used to obtain the first login identification and the second login identification of the user from the terminal in response to a login event initiated by the user based on the terminal; the first login identification is the login identification corresponding to the first authentication method; the second login identification is the login identification corresponding to the second authentication method;
[0118] The first authentication module 704 is used to read the first authentication information corresponding to the first login identifier from the storage space, and authenticate the first authentication information according to the first authentication method to obtain a first authentication result;
[0119] The second authentication module 706 is used to authenticate the second login identifier according to the second authentication method to obtain a second authentication result;
[0120] The information construction module 708 is used to construct first updated authentication information for the first login identifier based on the second login identifier when the first authentication result is failure and the second authentication result is success; the first updated authentication information is used to authenticate the first login identifier.
[0121] In an exemplary embodiment, the information authentication device 700 further includes a login registration module, which is specifically used to:
[0122] In response to a login identification request event initiated by a user based on a terminal, sending a login authentication instruction to the terminal;
[0123] In response to a login registration event initiated by the terminal based on the login authentication instruction, obtaining the user's login registration information from the terminal;
[0124] A first login identifier of a user corresponding to a first authentication method and a second login identifier of a user corresponding to a second authentication method are extracted from the login registration information.
[0125] In an exemplary embodiment, the first authentication module 704 is specifically configured to:
[0126] Reading a plurality of registered first information from the storage space;
[0127] If the first authentication information successfully matches any registered first information, determining the first authentication result is successful;
[0128] If the first authentication information fails to match with each registered first information, the first authentication result is determined to be a failure.
[0129] In an exemplary embodiment, the information authentication device 700 further includes a matching degree determination module, which is specifically used to:
[0130] If the first authentication result is successful, multiple candidate login identifiers are obtained from the storage space, and a candidate matching degree between the first authentication information and each candidate login identifier is determined;
[0131] When there is a target matching degree that satisfies the matching condition among the candidate matching degrees, the candidate registration identifier corresponding to the target matching degree is deleted from the storage space.
[0132] In an exemplary embodiment, the second authentication module 706 is specifically configured to:
[0133] Parsing the second login identifier to obtain second identification information corresponding to the second login identifier; the second identification information includes header information, payload information and signature information;
[0134] Encrypting the header information and the payload information based on the encryption algorithm corresponding to the second authentication method to obtain encrypted information;
[0135] If the encrypted information is consistent with the signature information, the second authentication result is determined to be successful;
[0136] If the encrypted information is inconsistent with the signature information, the second authentication result is determined to be a failure.
[0137] In an exemplary embodiment, the information construction module 708 is specifically used to:
[0138] Filtering associated information associated with the payload information from the storage space;
[0139] Based on the payload information and the associated information of the payload information, first updated authentication information for the first login identifier is constructed.
[0140] Each module in the above information authentication device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0141] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an information authentication method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0142] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0143] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program.
[0144] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0145] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0147] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0148] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0149] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An information authentication method, characterized in that: The method comprises: In response to a login event initiated by a user based on a terminal, a first login identifier and a second login identifier of the user are obtained from the terminal; the first login identifier is a login identifier corresponding to a first authentication method; the second login identifier is a login identifier corresponding to a second authentication method; Reading first authentication information corresponding to the first login identifier from the storage space, and authenticating the first authentication information according to the first authentication method to obtain a first authentication result; Authenticate the second login identifier according to the second authentication method to obtain a second authentication result; When the first authentication result is a failure and the second authentication result is a success, first updated authentication information for the first login identifier is constructed based on the second login identifier; the first updated authentication information is used to authenticate the first login identifier.
2. The method according to claim 1, characterized in that The method further comprises: In response to a login identification request event initiated by a user based on a terminal, sending a login authentication instruction to the terminal; In response to a login registration event initiated by the terminal based on the login authentication instruction, acquiring the login registration information of the user from the terminal; A first login identifier of the user corresponding to a first authentication method and a second login identifier of the user corresponding to a second authentication method are extracted from the login registration information.
3. The method according to claim 1, characterized in that The step of authenticating the first authentication information according to the first authentication method to obtain a first authentication result includes: Reading a plurality of registered first information from the storage space; If the first authentication information successfully matches any of the registered first information, determining that the first authentication result is successful; If the first authentication information fails to match each of the registered first information, it is determined that the first authentication result is a failure.
4. The method according to claim 3, characterized in that The method further comprises: If the first authentication result is successful, obtaining multiple candidate login identifiers from the storage space, and determining the candidate matching degree between the first authentication information and each of the candidate login identifiers; In the case that there is a target matching degree that satisfies the matching condition among the candidate matching degrees, the candidate login identifier corresponding to the target matching degree is deleted from the storage space.
5. The method according to claim 1, characterized in that Authenticating the second login identifier according to the second authentication method to obtain a second authentication result includes: Parsing the second login identifier to obtain second identification information corresponding to the second login identifier; the second identification information includes header information, payload information and signature information; Encrypting the header information and the payload information based on an encryption algorithm corresponding to the second authentication method to obtain encrypted information; If the encrypted information is consistent with the signature information, determining that the second authentication result is successful; If the encrypted information is inconsistent with the signature information, it is determined that the second authentication result is a failure.
6. The method according to claim 5, characterized in that The constructing the first update authentication information corresponding to the first login identifier based on the second login identifier includes: Filtering associated information associated with the load information from the storage space; Based on the payload information and the associated information of the payload information, first updated authentication information for the first login identifier is constructed.
7. An information authentication device, characterized in that: The device comprises: A login identification acquisition module, configured to acquire a first login identification and a second login identification of the user from the terminal in response to a login event initiated by the user based on the terminal; the first login identification is a login identification corresponding to the first authentication method; the second login identification is a login identification corresponding to the second authentication method; A first authentication module, configured to read first authentication information corresponding to the first login identifier from a storage space, and authenticate the first authentication information according to the first authentication method to obtain a first authentication result; A second authentication module, used to authenticate the second login identifier according to the second authentication method to obtain a second authentication result; An information construction module is used to construct first updated authentication information for the first login identifier based on the second login identifier when the first authentication result is failure and the second authentication result is success; the first updated authentication information is used to authenticate the first login identifier.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Multi-server switching response method and device without re-login, computer equipment and computer readable storage medium
CN116455659A
Two factor authentication using a digital one-time pad
US20210218734A1
