User distributed authentication method, device, electronic device and storage medium
Through the distributed authentication method, user information is obtained and verified based on the B-side authentication template, and updated to the business gateway, which solves the problems of slow and risky B-side user authentication in the existing technology, and achieves efficient and fast B-side user authentication improves service response speed and user satisfaction.
Patent Information
- Application Number
- CN202211012356.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2042-08-23
AI Technical Summary
The existing B-side user authentication solution cannot meet the efficient and fast authentication needs of airlines under the microservice architecture. As a result, each business request needs to access the unified authentication center, which is time-consuming and brings uncertain risks, and cannot be improved. Service quality for B-end users.
Through the distributed authentication method, user authentication information is obtained based on the B-side authentication template, verified for legality and updated to the business gateway, reducing dependence on the unified authentication center and enabling the business gateway to authenticate B-side user requests. and forward.
It improves the service response speed of B-side users, reduces additional requests to the unified authentication center, reduces the cost and risk of airlines, and improves the satisfaction of B-side users and the interests of airlines.
Smart Images

Figure CN115396178B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of software technology, and more specifically, to a user distributed authentication method, device, electronic device and storage medium. Background Art
[0002] As airlines continue to iterate their business services through microservices and productization, more and more B-side (representing business users and merchants) users are connected to backend business services. This places higher requirements on the authentication scenarios when B-side users provide services. Because the existing solutions require B-side user authentication every time a B-side user requests a backend business service, it is necessary to further improve the B-side user authentication speed while maintaining the original authentication capabilities. Therefore, how to implement an efficient and fast B-side user authentication solution has become a problem that needs to be solved urgently at this stage.
[0003] The existing B-side user authentication solution is based on a common unified authentication center, which obviously cannot meet the current B-side user authentication needs of airlines under the microservice architecture. Each business request must be authenticated at the authentication center, which will take a lot of time and need to bear the uncertain risks brought by the unified authentication center, which cannot effectively improve the service quality of B-side users. Summary of the invention
[0004] In view of this, in order to solve the above problems, the present disclosure provides a user distributed authentication method, device, electronic device and storage medium, and the technical solution is as follows:
[0005] A distributed user authentication method, the method comprising:
[0006] Obtain the B-side user authentication information based on the B-side authentication template;
[0007] Performing a legitimacy check on the B-side user authentication information, and publishing the B-side user authentication information if the legitimacy check passes;
[0008] Through the established monitoring mechanism, the published B-end user authentication information is updated to the business gateway, so that the business gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding background business service if the authentication is successful.
[0009] Optionally, the obtaining of the B-side user authentication information based on the B-side authentication template includes:
[0010] Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token;
[0011] The B-end token consists of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-end token, the partner, the expiration time, the issuance time, the B-end unique identifier, and the token creation time.
[0012] Optionally, the performing of a legitimacy check on the B-side user authentication information includes:
[0013] Performing a compliance check on the unique identifier of the B-end user, the validity period of the token, the authentication key, the list of available interfaces, the IP whitelist of the B-end user, and the B-end token;
[0014] Perform security verification on the expiration time in the payload of the B-side token and the signature in the B-side token.
[0015] Optionally, updating the published B-end user authentication information to the service gateway so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwarding the B-end user request to the corresponding background service if the authentication is successful, includes:
[0016] The published unique identifier of the B-end user, the validity period of the token, the authentication key, the list of available interfaces, the IP whitelist of the B-end user, and the B-end token are updated to the service gateway to achieve:
[0017] When the service gateway receives a request from the B-end user, it parses the updated B-end token to obtain the header, the payload and the signature; if the parsing fails, it outputs a prompt message indicating that the request is abnormal; if the parsing succeeds, it obtains the unique identifier of the B-end user in the B-end user request and matches it with the updated unique identifier of the B-end user; if the matching of the unique identifier of the B-end user fails, it outputs a prompt message indicating that the user does not exist; if the matching of the unique identifier of the B-end user succeeds, it determines the B-end user to whom the B-end user request belongs and matches it with the updated IP whitelist of the B-end user; if the matching of the B-end user fails, it outputs a prompt message indicating that the authentication has not passed; if the matching of the B-end user succeeds, it outputs a prompt message indicating that the authentication has not passed according to the validity period of the updated token and the obtained authentication information after parsing. The expiration time and the token creation time in the payload determine whether the updated B-end token is expired; if the updated B-end token is expired, a prompt message indicating that the authentication has expired is output; if the updated B-end token is not expired, the interface requested by the B-end user request is determined and matched with the updated list of available interfaces; if the interface requested by the B-end user request fails to match, a prompt message indicating that the authentication authority is insufficient is output; if the interface requested by the B-end user request matches successfully, the parsed signature is verified based on the updated authentication key; if the signature verification fails, a prompt message indicating that the authentication signature has not passed is output; if the signature verification succeeds, the B-end user request is forwarded to the corresponding background business service.
[0018] Optionally, the method further includes:
[0019] Respond to management operations on the authentication status of the B-side user under the target backend business service.
[0020] A user distributed authentication device, the device comprising:
[0021] UI front-end management module, used to obtain B-side user authentication information based on B-side authentication template;
[0022] The governance center is used to verify the legitimacy of the B-side user authentication information and publish the B-side user authentication information if the legitimacy verification passes;
[0023] The configuration center is used to update the published B-end user authentication information to the business gateway through the established monitoring mechanism, so that the business gateway can authenticate the received B-end user request based on the updated B-end user authentication information, and forward the B-end user request to the corresponding background business service if the authentication is successful.
[0024] Optionally, the UI front-end management module is specifically used to:
[0025] Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token;
[0026] The B-end token consists of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-end token, the partner, the expiration time, the issuance time, the B-end unique identifier, and the token creation time.
[0027] Optionally, the UI front-end management module is further used to:
[0028] Respond to management operations on the authentication status of the B-side user under the target backend business service.
[0029] An electronic device comprises: at least one memory and at least one processor; the memory stores an application program, the processor calls the application program stored in the memory, and the application program is used to implement the user distributed authentication method.
[0030] A storage medium stores computer program code, which implements the user distributed authentication method when executed.
[0031] Compared with the prior art, the beneficial effects achieved by the present disclosure are:
[0032] The present disclosure provides a user distributed authentication method, device, electronic device and storage medium. First, the B-end user authentication information is obtained based on the B-end authentication template; then, the B-end user authentication information is verified for legitimacy, and when the legitimacy verification passes, the B-end user authentication information is published; further, through the established monitoring mechanism, the published B-end user authentication information is updated to the service gateway, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding background service service when the authentication passes. Based on the present disclosure, the unified authentication center service of the original authentication scheme can be reduced by implementing distributed B-end user authentication in the service gateway, thereby reducing the additional authentication requests to the unified authentication center each time the B-end user makes a service request, thereby improving the service response speed of the B-end user. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0034] Figure 1 This is the signaling flow chart of the existing B-side user authentication solution;
[0035] Figure 2 A method flow chart of a user distributed authentication method provided by an embodiment of the present disclosure;
[0036] Figure 3 A schematic diagram of the structure of a method for implementing distributed user authentication provided by an embodiment of the present disclosure;
[0037] Figure 4 A signaling flow chart of a user distributed authentication method provided by an embodiment of the present disclosure;
[0038] Figure 5 A schematic diagram of the structure of a user distributed authentication device provided in an embodiment of the present disclosure;
[0039] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0040] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0041] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0042] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0043] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0044] The inventor has found through research that the B-side user authentication scheme of existing airlines is based on a common unified authentication center. Figure 1 , Figure 1 The signaling flow chart of the existing B-side user authentication solution is shown in FIG. Figure 1 The B-end user of the micro-services (i.e. the backend business service manager) submits the B-end user authentication request to the backend business service manager. After receiving the B-end user's request, the backend business service manager adds a B-end user as needed in the unified authentication center. After the unified authentication center responds successfully to the backend business service manager, the backend business service manager informs the B-end user of the success. The B-end user requests the backend business service (i.e. Figure 1 In the example, B requests the backend business service), the business gateway routes and forwards the B-side user request to the backend business service, and the backend business service requests authentication from the unified authentication center. After the authentication is successful, the unified authentication center performs business processing and returns a successful response to the B-side user. Therefore, under the existing solution, the authentication of user information is implemented in the unified authentication center. When all B-side users request the backend business service, the backend business service needs to request the unified authentication center for authentication when it receives the business request. Only when the authentication is passed will the subsequent business logic be processed. Otherwise, the requester will be informed that the authentication has not passed or the requester has insufficient authority.
[0045] From the above B-side user authentication solution, it can be seen that the current situation obviously cannot meet the B-side user authentication needs of current airlines under the microservice architecture. Each business request must be authenticated at the unified authentication center, which will take a lot of time and need to bear the uncertain risks brought by the unified authentication center, which cannot effectively improve the quality of B-side user services. In addition, there are the following main disadvantages:
[0046] 1. From the perspective of airline costs, it is necessary to provide specific B-side authentication requirements and invest a lot of human resources for independent development and access to the unified authentication center, including architecture resources, development resources, testing resources, etc.; 2. From the perspective of airline interests, because B-side user authentication was previously in the unified authentication center, different business backend services are required to maintain similar modules and connect to the unified authentication center. The authentication method of this solution requires an additional request to the unified authentication center for each request, resulting in reduced availability of services for B-side users, slower response speed, and significantly reduced B-side user satisfaction, which damages the interests and image of the airline; 3. From the perspective of industry management, for B-side user scenarios, the existing unified authentication center cannot promote the development of the airline's B-side user business.
[0047] Therefore, it seems very necessary to enable airlines to implement a safe, efficient and fast B-end user authentication solution for back-end business services, reduce the airline’s manpower costs, maintain the stability of B-end users, improve the response speed to B-end users, and achieve profit growth for airlines.
[0048] See also Figure 2 , Figure 2 A method flow chart of a user distributed authentication method provided by an embodiment of the present invention, the user distributed authentication method comprises the following steps:
[0049] S10, obtaining the B-side user authentication information based on the B-side authentication template.
[0050] In the disclosed embodiment, the B-end authentication template provides a unified and consistent information maintenance template for all B-end users, and provides a basic data structure for B-end users to implement distributed authentication in the service gateway. Based on the B-end authentication template, B-end user authentication information can be obtained.
[0051] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of the method for implementing distributed user authentication provided by the embodiment of the present disclosure. Figure 3 The UI front-end management module can provide a visual operation interface for the person in charge of the back-end business service, support the visual unified query and maintenance of the B-end user authentication information of each back-end business service, and can query the authentication results and effective status of each B-end user in real time. The effective status includes invalid state and valid state, which are mainly distinguished by the expiration time (expirationTime) field. When the current time is greater than the expiration time (expirationTime), it is in invalid state, otherwise, it is in valid state. And the person in charge of the back-end business service can modify the authentication data of the B-end user and make it effective according to the needs of the B-end user (that is, if the B-end user wants to extend the cooperation, he can extend the token validity period, that is, the expiration time (expirationTime), and the modification can take effect directly), and the B-end user and each back-end business service do not need any investment. In this regard, the UI front-end management module can respond to the management operation of the authentication status of the B-end user under the target back-end business service, and the management operation includes but is not limited to query, maintenance, and modification.
[0052] Continue to see Figure 3The UI front-end management module can also provide a B-end authentication template, which supports the business gateway to maintain consistency with the original unified authentication center under the B-end user distributed authentication solution. The B-end authentication template includes the B-end user unique identifier, token validity period, authentication key, available interface list, B-end user IP (Internet Protocol, International Interconnection Protocol) whitelist and B-end token. Among them, the B-end token is the token of the B-end user. After reaching a cooperation with the B-end user, the token issued to the B-end user can be used to access the cooperative services.
[0053] B-side token, this field stores the B-side authentication token information, which will be delivered to the B-side user in an offline encrypted manner. The B-side user's service uses the token to request the business gateway of the corresponding backend business service. It includes a header, a payload, and a signature. The payload includes the issuer, the purpose of the B-side token (also known as the subject), the audience, the expiration time, the issuance time, the unique identifier of the B-side (tokenId), and the token creation time. The signature stores the B-side user's signature, which ensures that the B-side user's token cannot be tampered with to prevent the B-side user from illegal operations.
[0054] Therefore, step S10 "obtaining the B-side user authentication information based on the B-side authentication template" can adopt the following steps:
[0055] Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token;
[0056] Among them, the B-side token is composed of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-side token, the partner, the expiration time, the issuance time, the B-side unique identifier, and the token creation time.
[0057] S20, perform a legitimacy check on the B-side user authentication information, and if the legitimacy check passes, release the B-side user authentication information.
[0058] Continue to see Figure 3The governance center can receive the B-side user authentication information (including the B-side user unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token) obtained based on the B-side authentication template transmitted from the UI management module, and then perform a legitimacy check on it. After the legitimacy check passes, the B-side user authentication information will be published to the configuration center.
[0059] In the specific implementation process, the "validity verification of the B-side user authentication information" in step S20 can be performed using the following steps:
[0060] Perform compliance checks on the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist, and B-side token; perform security checks on the expiration time in the payload of the B-side token and the signature in the B-side token.
[0061] In the disclosed embodiment, the B-end user authentication information includes the B-end user unique identifier, token validity period, authentication key, available interface list, B-end user IP whitelist and B-end token. Therefore, the B-end user unique identifier, token validity period, authentication key, available interface list, B-end user IP whitelist and B-end token can be checked for compliance. The content of each field is not empty, and the token validity period must be a positive integer, not a decimal, a negative number or a string. The authentication key must meet a special format (such as "year-month-day-hour-minute-second_partner identifier_airline two-character code"), the B-end user unique identifier must be unique and non-repetitive, and the token creation time in the payload of the B-end token is time. In addition, the expiration time in the payload of the B-end token and the signature in the B-end token need to be checked for security, that is, the expiration time must be greater than 0, and the signature is equal to the value generated by the algorithm of the B-end token and the authentication key.
[0062] S30, through the established monitoring mechanism, the published B-end user authentication information is updated to the business gateway, so that the business gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding background business service if the authentication is successful.
[0063] Continue to see Figure 3 The configuration center is responsible for the ultimate maintenance and storage of the B-side authentication data, and establishes a monitoring mechanism with the business gateway. When the business gateway monitors the changes in the B-side user authentication information of the configuration center, the B-side authentication configuration module of the business gateway will load the latest B-side user authentication information to the local computer for subsequent effectiveness.
[0064] The business gateway is responsible for completing the authentication function of the B-side user for each backend business service. It includes the B-side authentication configuration module, which is responsible for helping the business gateway obtain the latest B-side user authentication information from the configuration center in real time; the B-side authentication execution module uses the B-side user authentication information loaded by the B-side authentication configuration module to authenticate the request of the B-side user entering the business gateway. If the authentication is successful, the request will be forwarded to the backend business service, otherwise the request will be rejected.
[0065] It should be noted that Figure 3 When a B-side user sends a B-side user request to the business gateway, the B-side user request needs to pass through the whitelist IP machine and contain the B-side token.
[0066] In the specific implementation process, in step S30, "updating the published B-end user authentication information to the service gateway, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwarding the B-end user request to the corresponding backend service if the authentication is successful" can adopt the following steps:
[0067] The published B-side user unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token are updated to the business gateway to achieve:
[0068] When the service gateway receives the B-end user request, it parses the updated B-end token to obtain the header, payload and signature; if the parsing fails, it outputs a prompt message indicating that the request is abnormal; if the parsing is successful, it obtains the B-end user unique identifier in the B-end user request and matches it with the updated B-end user unique identifier; if the B-end user unique identifier matches unsuccessfully, it outputs a prompt message indicating that the user does not exist; if the B-end user unique identifier matches successfully, it determines the B-end user to whom the B-end user request belongs and matches it with the updated B-end user IP whitelist; if the B-end user matches unsuccessfully, it outputs a prompt message indicating that the authentication has not passed; if the B-end user matches successfully, it checks the B-end user according to the updated token validity period and the parsed The expiration time and token creation time in the obtained payload determine whether the updated B-side token is expired; if the updated B-side token is expired, a prompt message indicating that the authentication has expired is output; if the updated B-side token is not expired, the interface requested by the B-side user request is determined and matched with the updated list of available interfaces; if the interface requested by the B-side user request fails to match, a prompt message indicating insufficient authentication authority is output; if the interface requested by the B-side user request matches successfully, the parsed signature is verified based on the updated authentication key; if the signature verification fails, a prompt message indicating that the authentication signature has not passed is output; if the signature verification succeeds, the B-side user request is forwarded to the corresponding background business service.
[0069] See also Figure 4 , Figure 4 The signaling flow chart of the user distributed authentication method provided by the embodiment of the present disclosure. The present disclosure proposes a B-side user authentication solution based on the distributed authentication concept, which has efficient and fast B-side user authentication capabilities and reduces the authentication center service. Specifically, it includes the following steps:
[0070] Step 1: B-side users (i.e. Figure 4 The B-side user of the micro-services submits the B-side user authentication request to the backend business service manager. The business service manager returns a prompt message to the B-side user to inform him of the success.
[0071] Step 2: After receiving the authentication request from the B-side user, the backend business service manager will operate the B-side user authentication information in the UI front-end management module as needed. This operation will extend the validity period of the B-side token so that the cooperation with the B-side user can continue. The UI front-end management module will return a prompt message indicating a successful response to the business service manager.
[0072] Step 3: The UI front-end management module submits the B-side user authentication information to the governance center, which will verify the legitimacy of the B-side user authentication information. For example, the token validity period cannot contain illegal information, such as "xxxx"; for example, if the B-side token already exists, the B-side token cannot be changed to extend the validity period of the cooperation. The governance center returns a successful response prompt to the UI front-end management module.
[0073] Step 4: After the governance center completes the legality verification, the governance center publishes the B-side user authentication information to the configuration center for storage and waits for it to take effect. The configuration center returns a prompt message indicating a successful response to the governance center.
[0074] Step 5: After receiving the change and completing the storage, the configuration center notifies the business gateway of the B-side user authentication information change event, and the business gateway completes the B-side authentication information update through the B-side authentication configuration module. The business gateway returns a prompt message of successful response to the configuration center.
[0075] Step 6: When the B-side user requests background business services, he can directly request the business gateway and send the B-side user request to the business gateway.
[0076] Step 7: After the B-side user request reaches the business gateway, it enters the B-side authentication execution module of the business gateway. First, the B-side token updated in the B-side authentication configuration module is parsed to obtain the header, payload and signature in the B-side token. If the parsing fails, a prompt message indicating the request abnormality is output to inform the B-side user of the "request abnormality"; if the parsing succeeds, it proceeds to step 8.
[0077] Step 8: The B-side authentication execution module obtains the B-side user unique identifier from the B-side user request and matches it with the B-side user unique identifier updated in the B-side authentication configuration module. If the match fails, a prompt message indicating that the user does not exist is output to inform the B-side user that "the user does not exist"; if the match succeeds, go to step 9.
[0078] Step 9: The B-side authentication execution module determines the B-side user to whom the B-side user request belongs, and matches the source of the B-side user request with the B-side user IP whitelist updated in the B-side authentication configuration module. If the match fails, a prompt message indicating that the authentication failed is output, informing the B-side user that "authentication failed"; if the match succeeds, proceed to step 10.
[0079] Step 10: The B-side authentication execution module determines whether the updated B-side token is expired according to the token validity period updated in the B-side authentication configuration module, the expiration time in the parsed payload, and the token creation time. The expiration principle is to simultaneously meet "expiration time < current time" and "token creation time + token validity period < expiration time". Assume that the B-side token has been extended, but the B-side token must remain unchanged. Since the expiration time is recorded in the B-side token and cannot change, the additional token validity period and token creation time will be used for determination. By increasing the value of the token validity period, the effect of "token creation time + token validity period ≥ expiration time" can be achieved. The B-side token can continue to execute subsequent business logic through the authentication execution module of the business gateway. If it is expired, a prompt message indicating that the authentication has expired is output to inform the B-side user that "the authentication has expired"; if it has not expired, go to step 11.
[0080] Step 11: The B-side authentication execution module determines the interface requested by the B-side user request and matches it with the list of available interfaces updated in the B-side authentication configuration module. If the match fails, a prompt message indicating insufficient authentication authority is output to inform the B-side user that "the authentication authority is insufficient". If the match is successful, step S12 is entered.
[0081] Step 12: The B-side authentication execution module verifies the updated signature in the B-side authentication configuration module to determine that the information in the B-side user request has not been modified. Specifically, the authentication key updated in the B-side authentication configuration module uses the HS256 encryption algorithm to obtain the corresponding string, and uses the same method as the signature generated at the time to process the string, the header and the payload in the updated B-side token to obtain the signature for comparison. If the signature is consistent with the signature updated in the B-side authentication configuration module, the signature verification is successful, otherwise, the signature verification fails. If the signature verification fails, a prompt message indicating that the authentication signature has not passed is output, informing the B-side user that "the authentication signature has not passed"; if the signature verification is successful, proceed to step 13.
[0082] Step 13: The business gateway determines that the B-end user request is authenticated and forwards the B-end user request to the downstream backend business service. After the backend business service completes processing the B-end user request, it returns a successful response prompt to the business gateway, and the business gateway returns a successful response prompt to the B-end user.
[0083] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0084] According to the analysis of the investment cost of B-side user authentication of airlines under the microservice architecture, the original solution caused a large amount of resource waste, and the waste was continuous, because every time a B-side user requested a background business service, it was necessary to make an additional request to the unified authentication center once or even multiple times for authentication, and multiple background business services may need to be customized, which is not conducive to improving the response speed to the business requests of B-side users. The user distributed authentication method provided by the embodiment of the present disclosure reduces the unified authentication center service of the original authentication solution and reduces the additional authentication requests made by B-side users to the authentication center each time, thereby improving the service response speed to B-side users; and the B-side user authentication information can be efficiently and uniformly managed through a visual page, such as supporting the extension of B-side user authentication cooperation, thereby ensuring the efficiency of B-side user authentication management of airlines.
[0085] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0086] Although operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or in a sequential order.Multitasking and parallel processing may be advantageous under certain circumstances.
[0087] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0088] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0089] Based on the user distributed authentication method provided in the above embodiment, the embodiment of the present disclosure provides a device for executing the above user distributed authentication method. The structural diagram of the device is shown in FIG. Figure 5 As shown, including:
[0090] UI front-end management module 10, used to obtain B-side user authentication information based on B-side authentication template;
[0091] The governance center 20 is used to verify the legitimacy of the B-side user authentication information and, if the legitimacy verification passes, publish the B-side user authentication information;
[0092] The configuration center 30 is used to update the published B-end user authentication information to the business gateway through the established monitoring mechanism, so that the business gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding background business service if the authentication is successful.
[0093] Optionally, the UI front-end management module 10 is specifically used for:
[0094] Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token;
[0095] Among them, the B-side token is composed of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-side token, the partner, the expiration time, the issuance time, the B-side unique identifier, and the token creation time.
[0096] Optionally, the governance center 20 for verifying the legitimacy of the B-side user authentication information is specifically used to:
[0097] Perform compliance checks on the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist, and B-side token; perform security checks on the expiration time in the payload of the B-side token and the signature in the B-side token.
[0098] Optionally, it is used to update the published B-end user authentication information to the service gateway, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the configuration center 30 of the corresponding backend business service if the authentication is passed, specifically used for:
[0099] The published B-side user unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token are updated to the business gateway to achieve:
[0100] When the service gateway receives the B-end user request, it parses the updated B-end token to obtain the header, payload and signature; if the parsing fails, it outputs a prompt message indicating that the request is abnormal; if the parsing is successful, it obtains the B-end user unique identifier in the B-end user request and matches it with the updated B-end user unique identifier; if the B-end user unique identifier matches unsuccessfully, it outputs a prompt message indicating that the user does not exist; if the B-end user unique identifier matches successfully, it determines the B-end user to whom the B-end user request belongs and matches it with the updated B-end user IP whitelist; if the B-end user matches unsuccessfully, it outputs a prompt message indicating that the authentication has not passed; if the B-end user matches successfully, it checks the B-end user according to the updated token validity period and the parsed The expiration time and token creation time in the obtained payload determine whether the updated B-side token is expired; if the updated B-side token is expired, a prompt message indicating that the authentication has expired is output; if the updated B-side token is not expired, the interface requested by the B-side user request is determined and matched with the updated list of available interfaces; if the interface requested by the B-side user request fails to match, a prompt message indicating insufficient authentication authority is output; if the interface requested by the B-side user request matches successfully, the parsed signature is verified based on the updated authentication key; if the signature verification fails, a prompt message indicating that the authentication signature has not passed is output; if the signature verification succeeds, the B-side user request is forwarded to the corresponding background business service.
[0101] Optionally, the UI front-end management module 10 is further used to:
[0102] Respond to management operations on the authentication status of the B-side user under the target backend business service.
[0103] It should be noted that the detailed functions of each module in the embodiment of the present disclosure can be found in the corresponding public part of the above-mentioned user distributed authentication method embodiment, and will not be repeated here.
[0104] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0105] Based on the user distributed authentication method provided in the above embodiment, the embodiment of the present disclosure also provides an electronic device, the electronic device includes: at least one memory and at least one processor; the memory stores an application, the processor calls the application stored in the memory, and the application is used to implement the user distributed authentication method.
[0106] Reference below Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0107] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 606 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0108] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0109] Based on the user distributed authentication method provided in the above embodiment, the embodiment of the present disclosure further provides a storage medium, which stores computer program code, and the user distributed authentication method is implemented when the computer program code is executed.
[0110] In the context of the present disclosure, a storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A storage medium may be a machine-readable signal medium or a machine-readable storage medium. Storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0111] It should be noted that the storage medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any storage medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0112] The storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0113] According to one or more embodiments of the present disclosure, a user distributed authentication method is provided, comprising:
[0114] Obtain the B-side user authentication information based on the B-side authentication template;
[0115] Perform a legitimacy check on the user authentication information of the B side, and release the user authentication information of the B side if the legitimacy check passes;
[0116] Through the established monitoring mechanism, the published B-end user authentication information is updated to the business gateway, so that the business gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding background business service if the authentication is successful.
[0117] According to one or more embodiments of the present disclosure, a user distributed authentication method is provided, which obtains B-side user authentication information based on a B-side authentication template, including:
[0118] Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token;
[0119] Among them, the B-side token is composed of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-side token, the partner, the expiration time, the issuance time, the B-side unique identifier, and the token creation time.
[0120] According to one or more embodiments of the present disclosure, a user distributed authentication method is provided to verify the legitimacy of the B-side user authentication information, including:
[0121] Perform compliance verification on the unique identification of the B-side user, token validity period, authentication key, available interface list, B-side user IP whitelist, and B-side token;
[0122] Perform security verification on the expiration time in the payload of the B-side token and the signature in the B-side token.
[0123] According to one or more embodiments of the present disclosure, a user distributed authentication method is provided, which updates the published B-side user authentication information to the service gateway, so that the service gateway authenticates the received B-side user request based on the updated B-side user authentication information, and forwards the B-side user request to the corresponding background service if the authentication is successful, including:
[0124] The published B-side user unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token are updated to the business gateway to achieve:
[0125] When the service gateway receives the B-end user request, it parses the updated B-end token to obtain the header, payload and signature; if the parsing fails, it outputs a prompt message indicating that the request is abnormal; if the parsing is successful, it obtains the B-end user unique identifier in the B-end user request and matches it with the updated B-end user unique identifier; if the B-end user unique identifier matches unsuccessfully, it outputs a prompt message indicating that the user does not exist; if the B-end user unique identifier matches successfully, it determines the B-end user to whom the B-end user request belongs and matches it with the updated B-end user IP whitelist; if the B-end user matches unsuccessfully, it outputs a prompt message indicating that the authentication has not passed; if the B-end user matches successfully, it checks the B-end user according to the updated token validity period and the parsed The expiration time and token creation time in the obtained payload determine whether the updated B-side token is expired; if the updated B-side token is expired, a prompt message indicating that the authentication has expired is output; if the updated B-side token is not expired, the interface requested by the B-side user request is determined and matched with the updated list of available interfaces; if the interface requested by the B-side user request fails to match, a prompt message indicating insufficient authentication authority is output; if the interface requested by the B-side user request matches successfully, the parsed signature is verified based on the updated authentication key; if the signature verification fails, a prompt message indicating that the authentication signature has not passed is output; if the signature verification succeeds, the B-side user request is forwarded to the corresponding background business service.
[0126] According to one or more embodiments of the present disclosure, a user distributed authentication method is provided, further comprising:
[0127] Respond to management operations on the authentication status of the B-side user under the target backend business service.
[0128] According to one or more embodiments of the present disclosure, a user distributed authentication device is provided, the device comprising:
[0129] UI front-end management module, used to obtain B-side user authentication information based on B-side authentication template;
[0130] The governance center is used to verify the legitimacy of the B-side user authentication information and publish the B-side user authentication information if the legitimacy verification passes;
[0131] The configuration center is used to update the published B-end user authentication information to the business gateway through the established monitoring mechanism, so that the business gateway can authenticate the received B-end user request based on the updated B-end user authentication information, and forward the B-end user request to the corresponding background business service if the authentication is successful.
[0132] According to one or more embodiments of the present disclosure, a user distributed authentication device and a UI front-end management module are provided, which are specifically used for:
[0133] Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token;
[0134] Among them, the B-side token is composed of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-side token, the partner, the expiration time, the issuance time, the B-side unique identifier, and the token creation time.
[0135] According to one or more embodiments of the present disclosure, a user distributed authentication device and a UI front-end management module are provided, which are also used for:
[0136] Respond to management operations on the authentication status of the B-side user under the target backend business service.
[0137] According to one or more embodiments of the present disclosure, an electronic device is provided, the electronic device comprising: at least one memory and at least one processor; the memory stores an application program, the processor calls the application program stored in the memory, and the application program is used to implement a user distributed authentication method.
[0138] According to one or more embodiments of the present disclosure, a storage medium is provided, wherein the storage medium stores computer program code, and the computer program code implements a user distributed authentication method when executed.
[0139] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0140] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0141] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
Claims
1. A user distributed authentication method, characterized in that: The method comprises: Obtain the B-side user authentication information based on the B-side authentication template; Performing a legitimacy check on the B-side user authentication information, and publishing the B-side user authentication information if the legitimacy check passes; Through the established monitoring mechanism, the published B-end user authentication information is updated to the service gateway, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding backend service if the authentication is successful; The obtaining of the B-side user authentication information based on the B-side authentication template includes: Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token; The B-end token consists of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-end token, the partner, the expiration time, the issuance time, the B-end unique identifier, and the token creation time. The updating of the published B-end user authentication information to the service gateway, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding backend service if the authentication is successful, includes: The published unique identifier of the B-end user, the validity period of the token, the authentication key, the list of available interfaces, the IP whitelist of the B-end user, and the B-end token are updated to the service gateway to achieve: When the service gateway receives a request from the B-end user, it parses the updated B-end token to obtain the header, the payload and the signature; if the parsing fails, it outputs a prompt message indicating that the request is abnormal; if the parsing succeeds, it obtains the unique identifier of the B-end user in the B-end user request and matches it with the updated unique identifier of the B-end user; if the matching of the unique identifier of the B-end user fails, it outputs a prompt message indicating that the user does not exist; if the matching of the unique identifier of the B-end user succeeds, it determines the B-end user to whom the B-end user request belongs and matches it with the updated IP whitelist of the B-end user; if the matching of the B-end user fails, it outputs a prompt message indicating that the authentication has not passed; if the matching of the B-end user succeeds, it outputs a prompt message indicating that the authentication has not passed according to the validity period of the updated token and the obtained authentication information after parsing. The expiration time and the token creation time in the payload determine whether the updated B-end token is expired; if the updated B-end token is expired, a prompt message indicating that the authentication has expired is output; if the updated B-end token is not expired, the interface requested by the B-end user request is determined and matched with the updated list of available interfaces; if the interface requested by the B-end user request fails to match, a prompt message indicating that the authentication authority is insufficient is output; if the interface requested by the B-end user request matches successfully, the parsed signature is verified based on the updated authentication key; if the signature verification fails, a prompt message indicating that the authentication signature has not passed is output; if the signature verification succeeds, the B-end user request is forwarded to the corresponding background business service.
2. The method according to claim 1, characterized in that The legitimacy verification of the B-side user authentication information includes: Performing a compliance check on the unique identifier of the B-end user, the validity period of the token, the authentication key, the list of available interfaces, the IP whitelist of the B-end user, and the B-end token; Perform security verification on the expiration time in the payload of the B-side token and the signature in the B-side token.
3. The method according to claim 1, characterized in that The method further comprises: Respond to management operations on the authentication status of the B-side user under the target backend business service.
4. A user distributed authentication device, characterized in that: The device comprises: UI front-end management module, used to obtain B-side user authentication information based on B-side authentication template; The governance center is used to verify the legitimacy of the B-side user authentication information and publish the B-side user authentication information if the legitimacy verification passes; The configuration center is used to update the published B-end user authentication information to the service gateway through the established monitoring mechanism, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding backend service if the authentication is successful; The UI front-end management module is specifically used for: Based on the B-side authentication template, obtain the B-side user's unique identifier, token validity period, authentication key, available interface list, B-side user IP whitelist and B-side token; The B-end token consists of a header, a payload and a signature. The payload includes the issuer, the purpose of the B-end token, the partner, the expiration time, the issuance time, the B-end unique identifier, and the token creation time. The updating of the published B-end user authentication information to the service gateway, so that the service gateway authenticates the received B-end user request based on the updated B-end user authentication information, and forwards the B-end user request to the corresponding backend service if the authentication is successful, includes: The published unique identifier of the B-end user, the validity period of the token, the authentication key, the list of available interfaces, the IP whitelist of the B-end user, and the B-end token are updated to the service gateway to achieve: When the service gateway receives a request from the B-end user, it parses the updated B-end token to obtain the header, the payload and the signature; if the parsing fails, it outputs a prompt message indicating that the request is abnormal; if the parsing succeeds, it obtains the unique identifier of the B-end user in the B-end user request and matches it with the updated unique identifier of the B-end user; if the matching of the unique identifier of the B-end user fails, it outputs a prompt message indicating that the user does not exist; if the matching of the unique identifier of the B-end user succeeds, it determines the B-end user to whom the B-end user request belongs and matches it with the updated IP whitelist of the B-end user; if the matching of the B-end user fails, it outputs a prompt message indicating that the authentication has not passed; if the matching of the B-end user succeeds, it outputs a prompt message indicating that the authentication has not passed according to the validity period of the updated token and the obtained authentication information after parsing. The expiration time and the token creation time in the payload determine whether the updated B-end token is expired; if the updated B-end token is expired, a prompt message indicating that the authentication has expired is output; if the updated B-end token is not expired, the interface requested by the B-end user request is determined and matched with the updated list of available interfaces; if the interface requested by the B-end user request fails to match, a prompt message indicating that the authentication authority is insufficient is output; if the interface requested by the B-end user request matches successfully, the parsed signature is verified based on the updated authentication key; if the signature verification fails, a prompt message indicating that the authentication signature has not passed is output; if the signature verification succeeds, the B-end user request is forwarded to the corresponding background business service.
5. The device according to claim 4, characterized in that The UI front-end management module is also used for: Respond to management operations on the authentication status of the B-side user under the target backend business service.
6. An electronic device, characterized in that: The electronic device comprises: at least one memory and at least one processor; the memory stores an application, the processor calls the application stored in the memory, and the application is used to implement the user distributed authentication method described in any one of claims 1-3.
7. A storage medium, characterized in that: The storage medium stores computer program code, and when the computer program code is executed, the user distributed authentication method described in any one of claims 1 to 3 is implemented.
