Multi-system login method, device, electronic device and storage medium
By sending a request for authentication to the target management system and obtaining the Code code and token, the problem of insufficient disaster recovery of multi-system login is solved, and the disaster recovery of multi-system login is improved to ensure stability between systems.
Patent Information
- Application Number
- CN202210169227.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-02-23
AI Technical Summary
In the prior art, multi-system login is insufficient, and when a third-party management system fails, all business systems cannot log in and use normally.
By receiving user login operations, sending a request for authentication to the target management system, judging its passability, and obtaining Code code and tokens, and then obtaining a subsystem list, achieving disaster recovery improvement in multi-system login.
It improves the disaster recovery of multi-system login, ensuring that even if a third-party management system fails, it can log in through other management systems, avoiding the risk of single point of failure between systems.
Smart Images

Figure CN114567475B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for multi-system login. Background Art
[0002] With the development of computer technology, more and more businesses can be implemented and completed through computer equipment. For different businesses, it is usually necessary to log in to the corresponding business system to perform the corresponding operations. The system login, authentication and certification methods of each business system are usually executed independently by each system. This will result in multiple business systems requiring their own account passwords to log in, which leads to cumbersome operations and low efficiency. In order to avoid this situation, in the prior art, multiple systems are often managed uniformly by introducing a third-party management system. In other words, after the user logs in to the third-party management system using the account password, it is equivalent to logging in to all business systems that are connected to the third-party management system, that is, subsystems. This can reduce the operation of logging in to multiple systems and improve the efficiency of logging in. However, this leads to a new problem. If the third-party management system fails, all business systems will not be able to log in and use normally. Therefore, improving the disaster tolerance of multi-system login is a problem that needs to be solved. Summary of the invention
[0003] The embodiments of the present application provide a multi-system login method, device, electronic device, and storage medium, which can improve the disaster recovery of multi-system login.
[0004] In a first aspect, an embodiment of the present application provides a method for logging into multiple systems, the method comprising the following steps:
[0005] Receive the user's login operation;
[0006] Sending a request for authentication to a target management system, the target management system being determined according to the login operation, the target management system including a local management system and a third-party management system;
[0007] Determining whether the target management system passes the request authentication;
[0008] When the target management system passes the request authentication, obtaining the Code returned by the target management system;
[0009] Send the Code to the gateway service module to obtain the Token returned by the gateway service module;
[0010] Get the subsystem list based on the Token.
[0011] In a first aspect, an embodiment of the present application provides a multi-system login device, the device comprising:
[0012] A communication module, configured to receive a user's login operation; send a request for authentication to a target management system, the target management system being determined according to the login operation, the target management system including a local management system and a third-party management system;
[0013] A processing module, used for determining whether the target management system passes the request authentication;
[0014] The communication module is also used to obtain the Code returned by the target management system when the target management system passes the request authentication; send the Code to the gateway service module to obtain the Token returned by the gateway service module; and obtain the subsystem list according to the Token.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the processor and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method described in the first aspect.
[0017] Implementing the embodiments of the present application will have the following beneficial effects:
[0018] The above-mentioned multi-system login method, device, computer equipment and storage medium are used. After receiving the user's login operation, a request for authentication is sent to the target management system according to the user's login operation, wherein the target management system is determined according to the user's login operation. The target management system includes a local management system and a third-party management system. Then, it is determined whether the target management system passes the request authentication. In the case that the target management system passes the request authentication, the Code returned by the target management system is obtained. The Code is then sent to the gateway service module to obtain the Token returned by the gateway service module. Then the subsystem list is obtained according to the Token. In this way, multiple systems can be logged in through different target management systems in a variety of ways, thereby improving the disaster recovery of multi-system login. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0020] Figure 1 A schematic diagram of a system architecture provided for an embodiment of the present application;
[0021] Figure 2 A flowchart of a multi-system login method provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a login interface provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of a multi-system login device provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the composition of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0026] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0027] Reference to "embodiments" herein means that a particular feature, result, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0028] First, the professional terms and concepts involved in the embodiments of the present application are introduced.
[0029] (1)Token
[0030] Token is a string of characters generated by the server as a token for making requests to the client (electronic device). Token is a special frame that can control the site's possession of the media to distinguish between data frames and other control frames. In other words, Token can be understood as a code. Before some data is transmitted, the code must be checked first, and different codes are authorized for different data operations.
[0031] (2)Code
[0032] Code is the user credential obtained through user authorization, which is used to exchange with the server to obtain resource access credentials (Token).
[0033] (3) Springsecurity
[0034] Spring Security is a security framework that can provide declarative security access control solutions for Spring-based enterprise application systems. It provides a set of beans that can be configured in the Spring application context, making full use of Spring IoC, DI (Inversion of Control, DI: Dependency Injection) and AOP (Aspect-Oriented Programming) functions to provide declarative security access control functions for application systems, reducing the work of writing a lot of repetitive code for enterprise system security control.
[0035] (4) Symmetric encryption
[0036] Symmetric encryption refers to an encryption method that uses a single-key cryptosystem. The same key can be used for both encryption and decryption of information. It is also called single-key encryption. The key is the instruction that controls the encryption and decryption process. The algorithm is a set of rules that dictate how encryption and decryption are performed.
[0037] The working process is as follows: the data sender processes the plaintext (original data) and the encryption key together through a special encryption algorithm, and then turns it into a complex encrypted ciphertext and sends it out. After the receiver receives the ciphertext, if he wants to interpret the original text, he needs to use the encryption key and the inverse algorithm of the same algorithm (that is, the above-mentioned special encryption algorithm) to decrypt the ciphertext to restore it to readable plaintext.
[0038] (5) Asymmetric encryption
[0039] Asymmetric encryption algorithms require two keys for encryption and decryption. These two keys are the public key, referred to as the public key, and the private key, referred to as the private key. The public key and the private key are a pair. If the public key is used to encrypt data, it can only be decrypted with the corresponding private key; if the private key is used to encrypt data, it can only be decrypted with the corresponding public key.
[0040] The working process is as follows: Party B generates a pair of keys (public key and private key) and discloses the public key to other parties. Party A, who has obtained the public key, uses it to encrypt confidential information and then sends it to Party B. Party B then uses another private key (private key) that it keeps to decrypt the encrypted information. Party B can only use its private key (private key) to decrypt the information encrypted by the corresponding public key.
[0041] (6)MD5
[0042] MD5 Message-Digest Algorithm, a widely used cryptographic hash function, can generate a 128-bit (16-byte) hash value to ensure the integrity and consistency of information transmission.
[0043] In order to better understand the technical solutions of the embodiments of the present application, the system architecture that may be involved in the embodiments of the present application is introduced here. Figure 1 , is a schematic diagram of a system architecture provided in an embodiment of the present application. The system architecture may include: an electronic device 101 and a server 102. The electronic device 101 and the server 102 may communicate via a network. The network communication may be based on any wired and wireless network, including but not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), and a wireless communication network, etc.
[0044] The embodiment of the present application does not limit the number of electronic devices and servers, and the server can provide services for multiple electronic devices at the same time. In the embodiment of the present application, the electronic device is mainly a device used by the user for multi-system login, which can be used to communicate with the server to obtain a subsystem list to complete multi-system login. The electronic device can be a personal computer (PC), a laptop or a smart phone, and can also be an all-in-one machine, a handheld computer, a tablet computer (pad), a smart TV playback terminal, a car terminal or a portable device. The electronic device on the PC side, such as an all-in-one machine, etc., its operating system can include but is not limited to Linux system, Unix system, Windows series system (such as Windows xp, Windows7, etc.), Mac OS X system (Apple computer operating system) and other operating systems. The electronic device on the mobile side, such as a smart phone, etc., its operating system can include but is not limited to Android system, IOS (Apple mobile phone operating system), Window system and other operating systems.
[0045] The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The server can also be implemented as a server cluster consisting of multiple servers.
[0046] With the development of computer technology, more and more businesses can be realized and completed through computer equipment. For different businesses, it is usually necessary to log in to the corresponding business system to perform the corresponding operations. The system login, authentication and certification methods of each business system are usually executed independently by each system. This will result in multiple business systems requiring their own account passwords to log in, which leads to cumbersome operations and low efficiency. In order to avoid this situation, in the prior art, multiple systems are often managed uniformly by introducing a third-party management system. In other words, after the user logs in to the third-party management system using the account password, it is equivalent to logging in to all business systems connected to the third-party management system. This can reduce the operation of logging in to multiple systems and improve the efficiency of logging in. However, this leads to a new problem. If the third-party management system fails, all business systems will not be able to log in and use normally. Therefore, improving the disaster tolerance of multi-system login is a problem that needs to be solved.
[0047] In order to solve the above problems, the present application embodiment provides a multi-system login method, which can be applied to Figure 1By implementing this method, the disaster tolerance of multi-system login can be improved.
[0048] The embodiments of the present application are implemented based on a common service platform (CSP). CSP is a service platform that supports upper-level applications, including a gateway service module, an SDK module, and a user management system. Among them, the gateway service module is responsible for authorization and authentication. The SDK module refers to an SDK package that can be referenced by each subsystem (application system). The interceptor in SpringSecurity manages the permissions of each application, and each subsystem can obtain the menu list information owned by the current user through this module. The user management system is used for user login management, permission management, etc.
[0049] See also Figure 2 , is a flowchart of a multi-system login method provided in an embodiment of the present application. The method may include the following steps S201 to S206. Among them:
[0050] Step S201: receiving a login operation from a user.
[0051] Step S202: Send a request for authentication to the target management system, and the target management system determines it according to the login operation.
[0052] Requesting authentication means requesting to authenticate the user's identity, and determining whether the user has operation permissions and what operation permissions the user has based on the user's identity.
[0053] In a possible implementation, the login operation includes a first login operation, the target management system is determined according to the first login operation of the user, and the target management system includes a local management system and a third-party management system. The local management system is a user management system in the CSP, and the third-party management system is a user management system other than the user management system in the CSP. Figure 3 As shown in FIG. 1 , a schematic diagram of a login interface provided by an embodiment of the present application is shown. Button 301 indicates logging in using a third-party management system, and button 302 indicates logging in using a local management system. The user can quickly select a third-party management system or a local management system to log in by clicking button 301 or button 302. It is understandable that in Figure 3In the example, the first login operation of the user is to click button 301 or button 302. When the user clicks button 301 to log in using a third-party management system, the target management system is the third-party management system; when the user clicks button 302 to log in using a local management system, the target management system is the local management system. By allowing the user to click a button on an interface to select a local management system or a third-party management system for login, the user does not need to remember and enter the addresses of each system to log in, which simplifies the user's operation and improves the user experience.
[0054] In a possible implementation, the login operation includes a second login operation, and the second login operation is used to determine a login mode, and the login mode includes a first login mode and a second login mode. Figure 3 As shown, the first login method refers to the login method of inputting the account and password as shown in 304, and the second login method refers to the login method of scanning the code as shown in 303. In the case where the user logs in using the first login method, as shown in 304, after the user enters the account and password and clicks the login button, the user's login operation will be received, and a request for authentication will be sent to the target management system. In the case where the user logs in using the second login method, as shown in 303, after the user scans the code using another device and clicks the button for prompting the user to confirm the login, the user's login operation will be received, and a request for authentication will be sent to the target management system.
[0055] Step S203: Determine whether the target management system passes the requested authentication.
[0056] In a possible implementation, when the login mode is the first login mode, determining whether the target management system passes the request authentication may include steps A1 to A6 as shown below:
[0057] Step A1. Obtain a first input account number and a first input password according to the first login method.
[0058] It should be noted that the first input account number and the first input password are not the account number and password entered by the user, but refer to the account number and password after the account number and password entered by the user are encrypted once. This is because if the front end transmits in plain text, the account number and password will be at risk of leakage. Therefore, the front end will encrypt the account number and password when transmitting. Therefore, what is obtained is the encrypted first input account number and the first input password, not the account number and password entered by the user. The encryption processing method can be symmetric encryption or asymmetric encryption. The encryption processing methods for the account number and password can be the same or different. For example, the account number entered by the user can be encrypted using a symmetric encryption processing method, and the password entered by the user can be encrypted using an asymmetric encryption processing method.
[0059] Step A2. Send the first input account and the first input password to the Springsecurity framework, and the Springsecurity framework is used to decrypt the first input account to obtain the original input account and encrypt the first input password to obtain the second input password.
[0060] Among them, the original input account is the account entered by the user, and the second input password is not the password entered by the user, but the password after the password entered by the user is encrypted twice (the first encryption occurs during the front-end transmission mentioned above).
[0061] Step A3: Get the original account number and encrypted password in the database.
[0062] It should be noted that in order to ensure data security, the original account and encrypted password are stored in the database. The original account refers to the account generated when the user registers or set by the user. The encrypted password is not the password set by the user, but the password that is twice encrypted after the password set by the user.
[0063] In a possible implementation, the encrypted password is obtained through the MD5 algorithm. When we need to save certain password information for identity confirmation, if the password information is directly saved in the database in plain text without any confidentiality measures, the system administrator can easily obtain the original password information. Once this information is leaked, the password can also be easily deciphered. In order to increase security, it is necessary to encrypt the information that needs to be kept confidential in the database, so that even if someone gets the entire database, the original password information cannot be obtained without a decryption algorithm. The MD5 algorithm can solve this problem very well, because it can calculate an input string of any length to obtain an output of a fixed length, and only when the plain text is the same can the same ciphertext be obtained, and this algorithm is irreversible. Even if the encrypted ciphertext is obtained, it is impossible to calculate the plaintext through the decryption algorithm. In this way, the user's password can be saved in the form of an MD5 value (or other similar algorithms). When the user registers, the system calculates the password entered by the user into an MD5 value, and then compares it with the MD5 value saved in the system. If the ciphertext is the same, the password can be determined to be correct, otherwise the password is wrong. Through such steps, the system can determine the legitimacy of the user's login to the system without knowing the user's plain text password. This not only prevents the user's password from being known by users with system administrator privileges, but also increases the difficulty of cracking the password to a certain extent.
[0064] Step A4: Encrypt the original account to obtain an encrypted account.
[0065] An encrypted account is an account that is encrypted from the original account.
[0066] Step A5. Send the encrypted account and the encrypted password to the Springsecurity framework, which is used to decrypt the encrypted account to obtain the original account, and obtain the verification results of the original input account and the original account, the second input password and the encrypted password.
[0067] The verification result refers to whether the original input account successfully matches the original account, and whether the second input password successfully matches the encrypted password. If the original input account successfully matches the original account, and the second input password successfully matches the encrypted password, the verification result is a successful match. Otherwise, the verification result is an unsuccessful match.
[0068] Step A6: Determine whether the requested authentication is successful based on the verification result.
[0069] If the verification result is a successful match, it is determined that the request authentication is passed. If the verification result is an unsuccessful match, it is determined that the request authentication is not passed.
[0070] For example, on the one hand, the account number entered by the user is A, and the password is B. The account number obtained by the front-end transmission is A1 (account number A1 is the result of an encryption of account number A), and the password is B1 (password B1 is the result of an encryption of password B). Then the account number A1 and password B1 are passed to the SpringSecurity framework. The SpringSecurity framework decrypts account number A1 to obtain account number A again, and encrypts password B1 again to obtain B2 (password B2 is equivalent to the result of a double encryption of password B). On the other hand, the account number stored in the database corresponding to the account number A entered by the user is a, and the password is b2. Before passing it to SpringSecurity, account number a is encrypted to obtain account number a1, and password b2 is not processed. After the account number a1 and password b2 are passed to the SpringSecurity framework, the SpringSecurity framework decrypts account number a1 to obtain account number a, and then determines whether account number A matches account number a, and determines whether password B2 matches password b2. If account A matches account a, and password B2 matches password b2, the verification result is a successful match, and the request authentication is passed. If account A does not match account a, or password B2 does not match password b2, the verification result is an unsuccessful match, and the request authentication is not passed.
[0071] In a possible implementation, when the login mode is the second login mode, determining whether the target management system passes the request authentication may include steps B1 to B7 as follows:
[0072] Step B1. Obtain a Code according to the second login method.
[0073] The code is generated by the third-party management system when the code is scanned successfully. The code generated each time the code is scanned may be different, but there is a mapping relationship between the code and the user. Therefore, the corresponding user who scanned the code can be determined in the third-party management system based on the code.
[0074] Step B2: Send the Code to a third-party management system to obtain corresponding user information.
[0075] The gateway service module sends the Code to the third-party management system, and the third-party management system can query the user information of the corresponding user in the third-party management system according to the Code.
[0076] Step B3. Obtain the first account number and the first password in the database according to the user information query.
[0077] After the gateway service module obtains the user information in the third-party management system from the third-party management system, it queries the local management system according to the user information in the third-party management system to obtain the user information in the user's local management system. It queries the database according to the user information in the user's local management system to obtain the first account and the first password.
[0078] It should be noted that since it is impossible to directly obtain the account and password in the database through the user information in the third-party management system, it is necessary to use the local management system as a medium to indirectly obtain the account and password in the database. Therefore, the user information in the third-party management system should have some or all corresponding user information in the local management system. In other words, the local management system needs to add some or all of the user information of the user in the third-party management system, so that the corresponding user information in the local management system can be queried based on the user information in the third-party management system.
[0079] In a possible implementation, when the third-party management system cannot directly provide user information to the local management system for adding user information, that is, the third-party management system cannot provide the user information of the third-party management system through the interface, the user characteristic information provided by the user can be obtained, that is, the user information that can be used to identify a unique user, and the user characteristic information can be used to query the third-party management system to obtain other information of the user, and then the user information in the third-party management system is filled into the user information in the local management system and saved. By obtaining user characteristic information and automatically filling in other user information according to the user characteristic information, user operations can be reduced and the user experience can be improved.
[0080] In a possible implementation, when a third party can provide user information in a third-party management system, some or all of the user information provided by the third-party management system is obtained according to a preset parameter configuration (for example, the third-party management system includes user information of the entire organization of Group A, and Group A includes Organization A1, Organization A2, Organization A3, and Organization A4, each of which contains user information of users under its own organization, but only Organization A1 is related to the local management system, so the local management system can be pre-configured through parameters to only obtain the user information included under Organization A1), and the user information obtained in the third-party management system is added to the local management system. Among them, the user information is encrypted to improve information security.
[0081] Step B4. Send the first account and the first password to the Springsecurity framework.
[0082] In a possible implementation, the first account is encrypted before being sent to the Springsecurity framework, and then the Springsecurity framework decrypts the encrypted first account after receiving it to obtain the first account again.
[0083] Step B5. Obtain the second account number and the second password from the database.
[0084] It can be understood that the second account number and the second password in the database are obtained according to the user information in the local management system.
[0085] Step B6. Send the second account and the second password to the Springsecurity framework.
[0086] In a possible implementation, the second account is encrypted before being sent to the Springsecurity framework, and then the Springsecurity framework decrypts the encrypted second account after receiving it to obtain the second account again.
[0087] The Springsecurity framework is used to obtain the verification result of the first account and the second account, the first password and the second password. The verification result refers to whether the first account and the second account are matched successfully, and whether the first password and the second password are matched successfully. If the first account and the second account are matched successfully, and the first password and the second password are matched successfully, the verification result is a successful match. Otherwise, the verification result is an unsuccessful match.
[0088] Step B7: Determine whether the requested authentication is successful based on the verification result.
[0089] If the verification result is a successful match, it is determined that the request authentication is passed. If the verification result is an unsuccessful match, it is determined that the request authentication is not passed.
[0090] It is understandable that both times the account and password are retrieved from the database for matching, so the matching is usually successful. This matching is equivalent to the simulation login process.
[0091] Step S204: When the target management system passes the authentication request, obtain the Code returned by the target management system.
[0092] In other words, the Code is generated by the target management system.
[0093] Step S205: Send the Code to the gateway service module to obtain the Token returned by the gateway service module.
[0094] The validity period of the Code is shorter than that of the Token. The Code is used to obtain the Token, and the Token is used to determine the user's identity and thus the user's operation permissions.
[0095] In a possible implementation, the gateway service module used when logging in using a local management system or a third-party management system is the same gateway service module, that is, the gateway service module in the CSP, so that server resources can be saved. In the gateway service module, the differentiated processing of logging in using a local management system and logging in using a third-party management system is determined by the characteristic data "redirectType". That is to say, depending on the selected target management system, the data carried when obtaining the Token is also different. If the local management system is used for login, the data carried when obtaining the Token includes the Code code and the characteristic data "redirectType"; if the third-party management system is used for login, the data carried when obtaining the Token includes the Code code, but does not include the characteristic data "redirectType". The differentiated processing of logging in using a local management system and logging in using a third-party management system in the gateway service module can be embodied in the following steps C1-C2 and D1-D2. Among them, steps C1-C2 are processing methods for when the target management system is a local management system, and steps D1-D2 are processing methods for when the target management system is a third-party management system.
[0096] In a possible implementation, when the target management system is the local management system, sending the Code to the gateway service module to obtain the Token returned by the gateway service module includes steps C1 and C2:
[0097] Step C1: Send the Code to the gateway service module, and the gateway service module is used to send the Code to the local management system.
[0098] Step C2: Receive the Token sent by the gateway service module. The Token is sent from the local management system to the gateway service module.
[0099] It can be understood that, since the local management system and the gateway service module both belong to CSP, when the target management system is the local management system, the role played by the gateway service module is to forward the Code.
[0100] In a possible implementation, when the target management system is a third-party management system, sending the Code to the gateway service module to obtain the Token returned by the gateway service module includes steps D1 and D2:
[0101] Step D1: Send the Code to the gateway service module. The gateway service module is used to send the Code to the third-party management system. The third-party management system is used to return corresponding user information to the gateway service module according to the received Code.
[0102] That is to say, after receiving the Code, the gateway service module uses the Code to obtain the user information in the third-party management system of the user corresponding to the Code.
[0103] Step D2: Receive the Token sent by the gateway service module. The Token is generated by the gateway service module according to the received user information.
[0104] Specifically, after obtaining the user information in the third-party management system of the user, the gateway service module searches and obtains the user information in the local management system corresponding to the user according to the user information in the third-party management system of the user, and then generates a token according to the obtained user information in the local management system.
[0105] Step S206: Obtain a subsystem list according to the Token.
[0106] Among them, subsystems refer to various application systems that have integrated SDK.
[0107] In a possible implementation, the method of obtaining the subsystem list according to the Token is as follows: a request to obtain the subsystem list is sent to the gateway service module, and the gateway service module verifies the validity of the Token after receiving the request. After the verification is successful, the gateway service module accesses the subsystem to obtain the menu, and the SDK module on the subsystem determines the authority of the current user according to the Token, thereby returning the subsystem list owned by the current user and the menu list of each subsystem in the subsystem list. Thus, a method of logging into multiple systems in multiple ways is realized.
[0108] The method involved in the embodiment of the present application is described in detail above, and the device involved in the embodiment of the present application is introduced below.
[0109] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of a multi-system login device provided in an embodiment of the present application. Figure 4 As shown, the multi-system login device 400 includes:
[0110] Communication module 401, used to receive a user's login operation; used to send a request for authentication to a target management system, the target management system determines according to the login operation;
[0111] Processing module 402, used to determine whether the target management system passes the request authentication;
[0112] The communication module 401 is also used to obtain the Code returned by the target management system when the target management system passes the request authentication; send the Code to the gateway service module to obtain the Token returned by the gateway service module; and obtain the subsystem list according to the Token.
[0113] In a possible implementation, the login operation includes a first login operation, the target management system is determined according to the first login operation, and the target management system includes a local management system and a third-party management system.
[0114] In a possible implementation, the login operation includes a second login operation, and the second login operation is used to determine a login mode, and the login mode includes a first login mode and a second login mode.
[0115] In a possible implementation, the communication module 401 is specifically used to: send the Code code to the gateway service module, and the gateway service module is used to send the Code code to the local management system; receive the Token sent by the gateway service module, and the Token is sent by the local management system to the gateway service module.
[0116] In one possible implementation, the communication module 401 is specifically used to send the Code code to the gateway service module, the gateway service module is used to send the Code code to the third-party management system, the third-party management system is used to return corresponding user information to the gateway service module based on the received Code code; receive the Token sent by the gateway service module, and the Token is generated by the gateway service module based on the received user information.
[0117] In a possible implementation, the communication module 401 is specifically used to obtain a first input account and a first input password according to the first login method; send the first input account and the first input password to the Springsecurity framework, and the Spring security framework is used to decrypt the first input account to obtain the original input account and encrypt the first input password to obtain the second input password; obtain the original account and the encrypted password in the database. The processing module 402 is specifically used to encrypt the original account to obtain the encrypted account. The communication module 401 is also used to send the encrypted account and the encrypted password to the Springsecurity framework, and the Springsecurity framework is used to decrypt the encrypted account to obtain the original account, and obtain the verification result of the original input account and the original account, the second input password and the encrypted password. The processing module is also used to determine whether the request authentication is passed according to the verification result.
[0118] In a possible implementation, the communication module 401 is used to obtain the Code code according to the second login method; send the Code code to the third-party management system to obtain the corresponding user information; query the first account and the first password in the database according to the user information; send the first account and the first password to the Springsecurity framework; obtain the second account and the second password in the database; send the second account and the second password to the Springsecurity framework; the Springsecurity framework is used to obtain the verification result of the first account and the second account, the first password and the second password. The processing module 402 is used to determine whether the request authentication is passed according to the verification result.
[0119] For specific functional implementation of the multi-system login device 400, please refer to Figure 2 The corresponding method steps will not be repeated here.
[0120] See also Figure 5 , is a schematic diagram of the composition of an electronic device provided in an embodiment of the present application. It may include: a processor 110, a memory 120; wherein the processor 110, the memory 120 and the communication interface 130 are connected via a bus 140, the memory 120 is used to store instructions, and the processor 110 is used to execute the instructions stored in the memory 120 to implement the above Figure 2 The corresponding method steps.
[0121] The processor 110 is used to execute the instructions stored in the memory 120 to control the communication interface 130 to receive and send signals and complete the steps in the above method. The memory 120 can be integrated in the processor 110 or can be set separately from the processor 110.
[0122] As an implementation, the function of the communication interface 130 may be implemented by a transceiver circuit or a dedicated transceiver chip. The processor 110 may be implemented by a dedicated processing chip, a processing circuit, a processor or a general-purpose chip.
[0123] As another implementation method, it is possible to use a general-purpose computer to implement the computer device provided in the embodiment of the present application. That is, the program code that implements the functions of the processor 110 and the communication interface 130 is stored in the memory 120, and the general-purpose processor implements the functions of the processor 110 and the communication interface 130 by executing the code in the memory 120.
[0124] For the concepts, explanations, detailed descriptions and other steps related to the technical solutions provided in the embodiments of the present application and involved in the computer device, please refer to the description of the method steps executed by the device in the aforementioned method or other embodiments, which will not be repeated here.
[0125] As another implementation of this embodiment, a computer-readable storage medium is provided, on which instructions are stored. When the instructions are executed, the method in the above method embodiment is executed.
[0126] As another implementation of this embodiment, a computer program product including instructions is provided, and when the instructions are executed, the method in the above method embodiment is performed.
[0127] Those skilled in the art will appreciate that for ease of description, Figure 5 Only one memory and processor are shown. In an actual electronic device or server, there may be multiple processors and memories. The memory may also be referred to as a storage medium or a storage device, etc., which is not limited in the embodiments of the present application.
[0128] It should be understood that in the embodiments of the present application, the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
[0129] It should also be understood that the memory mentioned in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM).
[0130] It should be noted that when the processor is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, the memory (storage module) is integrated in the processor.
[0131] It should be noted that the memory described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0132] In addition to the data bus, the bus may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, various buses are marked as buses in the figure.
[0133] It should also be understood that the first, second, third, fourth and various numerical numbers involved in this document are only distinctions made for the convenience of description and are not intended to limit the scope of the present application.
[0134] It should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0135] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software modules in a processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0136] In various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0137] Those skilled in the art will appreciate that the various illustrative logical blocks (ILBs) and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0138] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0141] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0142] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for logging into multiple systems. It is characterized in that The method comprises: Receive a login operation of a user, the login operation including a login operation using a third-party management system and a login operation using a local management system, the login operation including a second login operation, the second login operation is used to determine a login mode, and the login mode includes a second login mode; Sending a request for authentication to a target management system, the system used by the target management system is determined according to the login operation, the system used by the target management system includes a local management system and a third-party management system, when the login operation is a login operation using a third-party management system, determining that the target management system uses the third-party management system for login, when the login operation is a login operation using a local management system, determining that the target management system uses the local management system for login; Determine whether the target management system passes the request authentication, and the determination of whether the target management system passes the request authentication includes: obtaining a Code code according to the second login method, wherein the Code code is generated by a third-party management system when the code is scanned successfully, and the Code code generated each time the code is scanned is different, and there is a mapping relationship between the Code code and the user; sending the Code code to the third-party management system to obtain the corresponding user information; obtaining the first account and the first password in the database according to the user information query; sending the first account and the first password to the Spring security framework; obtaining the second account and the second password in the database; sending the second account and the second password to the Spring security framework; the Spring security framework is used to obtain the verification results of the first account and the second account, the first password and the second password; determining whether the request authentication is passed according to the verification results; When the target management system passes the request authentication, obtaining the Code returned by the target management system; Send the Code to the gateway service module to obtain the Token returned by the gateway service module; Get the subsystem list based on the Token.
2. The method according to claim 1, It is characterized in that The login operation includes a first login operation, the target management system is determined according to the first login operation, and when the target management system is the local management system, the sending of the Code to the gateway service module to obtain the Token returned by the gateway service module includes: Sending the Code to a gateway service module, wherein the gateway service module is used to send the Code to the local management system; Receive a Token sent by the gateway service module, where the Token is sent by the local management system to the gateway service module.
3. The method according to claim 1, It is characterized in that The login operation includes a first login operation, and the target management system is determined according to the first login operation. When the target management system is the third-party management system, the sending of the Code to the gateway service module to obtain the Token returned by the gateway service module includes: Send the Code to the gateway service module, the gateway service module is used to send the Code to the third-party management system, the third-party management system is used to return corresponding user information to the gateway service module according to the received Code; Receive a Token sent by the gateway service module, where the Token is generated by the gateway service module according to the received user information.
4. The method according to claim 2 or 3, It is characterized in that The login operation includes a second login operation, the second login operation is used to determine a login method, the login method includes a first login method, and the determining whether the target management system passes the request authentication includes: Obtaining a first input account number and a first input password according to the first login method; Sending the first input account and the first input password to the Spring security framework, the Spring security framework is used to decrypt the first input account to obtain the original input account and encrypt the first input password to obtain the second input password; Get the original account and encrypted password in the database; Encrypting the original account to obtain an encrypted account; Send the encrypted account and the encrypted password to the Spring security framework, and the Spring security framework is used to decrypt the encrypted account to obtain the original account, and obtain the verification result of the original input account and the original account, the second input password and the encrypted password; Determine whether the request authentication is passed according to the verification result.
5. The method according to claim 1, It is characterized in that The method further comprises: Acquire user characteristic information, where the user characteristic information is used to identify a unique user; According to the user characteristic information, query and obtain other information of the user corresponding to the user characteristic information in the third-party management system; The other information of the user corresponding to the user characteristic information is saved in the local management system.
6. The method according to claim 1, It is characterized in that The method further comprises: Obtain user information of the third-party management system according to pre-set parameter configuration; Add the user information to the local management system.
7. A multi-system login device, the device being used to execute the method according to any one of claims 1 to 6, It is characterized in that The device comprises: A communication module is used to receive a user's login operation, wherein the login operation includes a login operation using a third-party management system and a login operation using a local management system; send a request for authentication to a target management system, wherein the system used by the target management system is determined according to the login operation, wherein the system used by the target management system includes a local management system and a third-party management system; when the login operation is a login operation using a third-party management system, it is determined that the target management system uses the third-party management system for login; and when the login operation is a login operation using a local management system, it is determined that the target management system uses the local management system for login; A processing module, used for determining whether the target management system passes the request authentication; The communication module is also used to obtain the Code returned by the target management system when the target management system passes the request authentication; send the Code to the gateway service module to obtain the Token returned by the gateway service module; and obtain the subsystem list according to the Token.
8. An electronic device, It is characterized in that The method comprises a processor and a memory, wherein the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 6.
