Login management method, device, electronic device and readable storage medium
By managing user information through global sessions, users can access multiple systems with a single login, solving the problem of low efficiency when logging into multiple systems and improving the user experience.
Patent Information
- Application Number
- CN202210920175.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-01
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2042-08-01
AI Technical Summary
In existing technologies, multiple login operations between different business systems result in poor user experience and low efficiency.
By creating a global session and saving user information, users can access multiple systems with a single login and perform login operations on subsequent systems using the global session, reducing repetitive input.
It improved user login efficiency, enhanced user experience, and simplified the login process across multiple systems.
Smart Images

Figure CN115529154B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of the Internet, and in particular to a login management method, device, electronic device and readable storage medium. Background Art
[0002] The company will develop different business systems based on different businesses, and different systems will set up independent user data. When users need to log in to different business systems, they need to perform multiple login operations, which affects the experience and efficiency. Summary of the invention
[0003] The present application provides a login management method, device, electronic device and readable storage medium, aiming to solve the technical problem of low efficiency in multi-system login in the prior art.
[0004] In order to solve the above technical problem or at least partially solve the above technical problem, the present application provides a login management method, which includes the steps of:
[0005] receiving a first access request, acquiring user information and a first system identifier corresponding to the first access request, and performing a login operation of a system corresponding to the first system identifier according to the user information;
[0006] Creating a global session and saving the user information to the global session;
[0007] Receive a second access request, obtain a second system identifier in the second access request, and perform a login operation of the system corresponding to the second system identifier through the global session, wherein the first access request is an access request received when the global session is invalid, and the second access request is an access request received when the global session is valid.
[0008] Optionally, the step of performing a login operation of a system corresponding to the first system identifier according to the user information includes:
[0009] Sending the user information and the first system identifier to an authentication server;
[0010] Receiving a first authorization code returned by the authentication server based on the user information and the first system identifier;
[0011] Sending the first authorization code to the authentication server to receive a first access token returned by the authentication server based on the first authorization code;
[0012] The first access token is saved to the gateway.
[0013] Optionally, the user information includes a user account, a password, and a permission category; and the step of receiving a first authorization code returned by the authentication server based on the user information and the first system identifier includes:
[0014] Receive a first authorization code corresponding to the permission category, which is returned by the authentication server after successfully performing identity authentication using the user account, password, and the first system identifier.
[0015] Optionally, the step of performing a login operation of a system corresponding to the second system identifier through the global session includes:
[0016] Obtaining user information and login status information in the global session, and determining whether the current login status is valid according to the login status information;
[0017] If the current login status is valid, sending the second system identifier to the authentication server, and receiving a second authorization code returned by the authentication server based on the second system identifier;
[0018] Sending the second authorization code to the authentication server to receive a second access token returned by the authentication server based on the second authorization code;
[0019] The second access token is saved to the gateway.
[0020] Optionally, the step of determining whether the current login status is valid according to the login status information includes:
[0021] Obtain the preset login time limit, and obtain the login duration in the login status information;
[0022] Determine whether the login time is less than the preset login time limit;
[0023] If the login duration is less than the preset login time limit, the current login status is valid.
[0024] Optionally, the step of obtaining user information and a first system identifier corresponding to the first access request, and performing a login operation of a system corresponding to the first system identifier according to the user information includes:
[0025] Obtaining the external software identifier in the first access request, and returning a login entry corresponding to the external software identifier, so that the user can log in and authorize the platform server corresponding to the external software identifier according to the login entry;
[0026] Receiving a third access token and the user information returned by the platform server after completing the login authorization;
[0027] A fourth access token is generated according to the third access token, the user information and the first system identifier, and the fourth access token is saved to the gateway.
[0028] Optionally, after the step of creating a global session and saving the user information in the global session, the step further includes:
[0029] If an exit instruction including any system identifier is received, the global session and the user information are cleared, and it is determined whether there is a currently logged-in system;
[0030] If there is a logged-in system, exit the logged-in system.
[0031] To achieve the above object, the present invention further provides a login management device, the login management device comprising:
[0032] A first receiving module is used to receive a first access request, obtain user information and a first system identifier corresponding to the first access request, and perform a login operation of the system corresponding to the first system identifier according to the user information;
[0033] A first creation module, used for creating a global session and saving the user information into the global session;
[0034] The second receiving module is used to receive a second access request, obtain a second system identifier in the second access request, and perform a login operation of the system corresponding to the second system identifier through the global session, wherein the first access request is an access request received when the global session is invalid, and the second access request is an access request received when the global session is valid.
[0035] To achieve the above objectives, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the login management method as described above when executed by the processor.
[0036] To achieve the above object, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the login management method as described above are implemented.
[0037] The present invention proposes a login management method, device, electronic device and readable storage medium, which receive a first access request, obtain user information and a first system identifier corresponding to the first access request, and perform a login operation of the system corresponding to the first system identifier according to the user information; create a global session, and save the user information to the global session; receive a second access request, obtain a second system identifier in the second access request, and perform a login operation of the system corresponding to the second system identifier through the global session, wherein the first access request is an access request received when the global session is invalid, and the second access request is an access request received when the global session is valid. By generating a global session and saving user information at the first login, the user only needs to enter user information at the first login, and can log in directly through the global session without entering user information when logging in to other systems subsequently, thereby improving the user's login efficiency and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0040] Figure 1 This is a flow chart of a first embodiment of a login management method of the present invention;
[0041] Figure 2 A flowchart of a login operation in the login management method of the present invention;
[0042] Figure 3 It is a schematic diagram of the overall process of the login management method of the present invention;
[0043] Figure 4 It is a schematic diagram of the module structure of the electronic device of the present invention. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present application.
[0045] The present invention provides a login management method, referring to Figure 1 , Figure 1 This is a flow chart of a first embodiment of a login management method of the present invention, wherein the method comprises the following steps:
[0046] Step S10, receiving a first access request, obtaining user information and a first system identifier corresponding to the first access request, and performing a login operation of the system corresponding to the first system identifier according to the user information;
[0047] The first access request is an access request received when the global session is invalid; the first access request is sent by the user, specifically, the user can trigger the first access request in the login interface of the corresponding software or web page; taking the web page as an example, when the user enters the login interface, it is determined whether the user is logged in at this time, such as by introducing the sso-client class to detect the user's login status; when the user is not currently logged in, an input area for user information is displayed on the login interface for the user to fill in the user information, and the system to be logged in is selected on the login interface, and the corresponding first system identifier is automatically matched based on the system selected by the user; it should be noted that the user information can be directly entered by the user in the login interface, or it can be provided through external software authorization, such as by providing a QR code of the external software, the user scans the QR code to authorize the user information, and then obtains the user information from the platform server of the external software; it should be noted that the user can also be allowed to first select the system to be logged in, and then display the corresponding login interface according to the system selected by the user. After obtaining the user information and the first system identifier, the login operation can be performed. Specifically, the present application is applied to a user login module. The user login module is connected to an authentication server. The user login module sends the first system identifier and the user information to the authentication server. The authentication server determines the system to be logged in based on the first system identifier, and performs authentication through the user information to complete the system login.
[0048] Step S20, creating a global session and saving the user information to the global session;
[0049] After the login operation is successfully executed, a global session is created; it can be understood that all systems use the same login authentication interface for login authentication, and the global session corresponds to a conversation session ID, and the same session ID is used to represent login operations based on the same user information;
[0050] Step S30, receiving a second access request, obtaining a second system identifier in the second access request, and performing a login operation of the system corresponding to the second system identifier through the global session, wherein the second access request is an access request received when the global session is valid.
[0051] The triggering method of the second access request can be set by analogy with the first access request, which will not be described here. When the user enters the login interface, it is determined whether the user is logged in at this time, such as by introducing the sso-client class to detect the user's login status; when the user is currently logged in, the selectable systems are displayed on the login interface, and the user selects the system to be logged in, and the corresponding second system identifier is matched based on the user's selection; based on the same global session, the authentication server is logged in to the authentication server, and the authentication server determines the system to be logged in based on the second system identifier, and then completes the login operation.
[0052] This embodiment generates a global session and saves user information at the first login, so that the user only needs to enter the user information at the first login. When logging into other systems subsequently, there is no need to enter the user information and the user can log in directly through the global session, thereby improving the user's login efficiency and enhancing the user experience.
[0053] Further, see Figure 2 In the second embodiment of the login management method of the present invention proposed based on the first embodiment of the present invention, the step S10 includes the steps of:
[0054] Step S11, sending the user information and the first system identifier to an authentication server;
[0055] Step S12, receiving a first authorization code returned by the authentication server based on the user information and the first system identifier;
[0056] Step S13: sending the first authorization code to the authentication server to receive a first access token returned by the authentication server based on the first authorization code;
[0057] Step S14: Save the first access token to the gateway.
[0058] The user login module sends the user information and the first system identifier to the authentication server, and the authentication server verifies the user information. Specifically, the user information includes the user account, password, and permission category; the step S12 includes the steps of:
[0059] Step S121, receiving a first authorization code corresponding to the permission category, which is returned by the authentication server after successful identity authentication using the user account, password and the first system identifier.
[0060] The authentication server pre-stores authorized user accounts and passwords. When the user information matches the user account and password stored in the authentication server, the identity authentication is successful. After the identity authentication is successful, the authentication server generates a first authorization code corresponding to the first system identifier. Furthermore, different permissions, that is, permission categories, can be set for the corresponding user accounts according to different user identities. Different permission categories correspond to different systems that can be logged in, and the range of applicable functions within the corresponding single system is different. When performing identity authentication, it is also necessary to verify whether the first system identifier and the corresponding permission category are consistent. If not, the verification fails. It should be noted that the business system can report user information in batches to the unified user center, and the unified user center provides an interface for the business system to pull user information.
[0061] After the verification is passed, the authentication server sends the first authorization code to the user login module. The user login module exchanges the first authorization code for the first access token accessToken through the authentication server, and saves the first access token to the gateway to complete the login operation.
[0062] Further, see Figure 3 , user accounts can be divided into domain accounts and ordinary accounts:
[0063] If it is a domain account, ldap domain account verification is performed. After the verification is passed, subsequent login operations are performed. At the same time, the user can update the domain account or associate or modify it with a normal account. When the verification fails, the login interface prompts that the account or password is wrong, and when the number of errors reaches a preset number of errors, the account is locked. The preset number of errors can be set according to actual application needs. In this embodiment, it is 2. In addition, a mobile phone verification code login method can be introduced to log in.
[0064] If it is an ordinary account, a unified user ordinary account verification will be performed, and subsequent login operations will be performed after the verification is passed. If the ordinary account is logging in for the first time, it can be set to jump to the password modification page for the user to modify the password; when the verification fails, the login interface will prompt that the account or password is wrong, and the user is required to re-enter the account and password. It should be noted that ordinary accounts can also set corresponding verification rules when the verification fails, which will not be repeated here.
[0065] The step S30 comprises the steps of:
[0066] Step S31, obtaining user information and login status information in the global session, and determining whether the current login status is valid according to the login status information;
[0067] Step S32: if the current login status is valid, sending the second system identifier to the authentication server, and receiving a second authorization code returned by the authentication server based on the second system identifier;
[0068] Step S33: sending the second authorization code to the authentication server to receive a second access token returned by the authentication server based on the second authorization code;
[0069] Step S34: Save the second access token to the gateway.
[0070] The method for obtaining the second authorization code is similar to that for the first authorization code. The difference is that the authentication server determines the login operation as the same user through the global session. Therefore, it is only necessary to determine the system to be logged in through the second system identifier, and other steps will not be repeated.
[0071] The login status information is used to characterize the login status of the user information. The login status information can be obtained by determining the login record through the cookies information submitted on the login interface; the login status information is used to determine whether the login status of the current user information is still valid. Only when the login status is valid can the subsequent login operation be directly performed. Specifically, the step S31 includes the steps of:
[0072] Step S311, obtaining a preset login time limit, and obtaining the login time in the login status information;
[0073] Step S312, determining whether the login duration is less than the preset login time limit;
[0074] Step S313: If the login duration is less than the preset login time limit, the current login status is valid.
[0075] The preset login time limit is used to indicate the effective duration of a single user information login. The preset login time limit can be set based on the actual application scenario and needs. When the first system identifier corresponds to the system login successfully, the login time limit begins to be counted; when the login time reaches the preset login time limit, the login status is invalidated, and the user needs to re-enter the user information to log in; different rules can also be set according to actual needs. For example, when the login status is invalid, the login status of the currently logged-in system is maintained, but if a new system needs to be logged in, the user needs to re-enter the user information, or, when the login status expires, the login status of the currently logged-in system is invalidated. Whether using the currently logged-in system or logging in to a new system, the user needs to re-enter the user information, and the global session can be cleared at this time. When the current login status is valid, the user can log in to the new system without entering user information.
[0076] After step S20, the following steps are included:
[0077] Step S40, if a logout instruction including any system identifier is received, clearing the global session and the user information, and determining whether there is a currently logged-in system;
[0078] Step S50: if there is a logged-in system, exit the logged-in system.
[0079] In this embodiment, a unified user logout mechanism is set. When a user logout instruction for any system is received, the global session is cleared and all currently logged-in systems are logged out. When accessing the system that was originally logged in, the user information needs to be re-entered to log in. It should be noted that when clearing the global session, the login status can be set to invalid at the same time. Each time the system is accessed or a new system is logged in, the validity of the login status is checked. If the login status is invalid, the user information needs to be re-entered. If the login status is valid, it can be directly accessed or logged in.
[0080] This embodiment can implement timeliness management of login and logout rules, further improving the management capability of the system.
[0081] Further, in the third embodiment of the login management method of the present invention proposed based on the first embodiment of the present invention, the step S10 includes the steps of:
[0082] Step S15, obtaining the external software identifier in the first access request, and returning a login entry corresponding to the external software identifier, so that the user performs login authorization to the platform server corresponding to the external software identifier according to the login entry;
[0083] Step S16, receiving the third access token and the user information returned by the platform server after completing the login authorization;
[0084] Step S17: Generate a fourth access token according to the third access token, the user information and the first system identifier, and save the fourth access token to the gateway.
[0085] In this embodiment, in addition to logging in by the user inputting user information, authorized login can also be performed through software, such as Feishu, WeChat, etc. Specifically, the user selects an external software identifier on the login interface to determine the external software that needs to be authorized. After receiving the external software identifier, the corresponding login entry of the external software is returned. The login entry includes but is not limited to a QR code, a link, etc.; taking the login entry as a QR code as an example, the user initiates a request to the platform server of the external software by scanning the QR code, and the platform server returns user information, such as a nickname, avatar, etc. to the user device for authorization confirmation. After the user confirms, the authorization code transmitted by the platform server is received, and then the third access token and user information are obtained from the platform server. The user information contains openid, and the user identity is determined by openid, and a fourth access token is generated based on the third access token, user information and the first system identifier; the specific generation method of the fourth access token can be analogous to the aforementioned first access token, which will not be repeated here.
[0086] This embodiment expands the login method and improves the user experience.
[0087] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0089] The present application also provides a login management device for implementing the above login management method, the login management device comprising:
[0090] A first receiving module is used to receive a first access request, obtain user information and a first system identifier corresponding to the first access request, and perform a login operation of the system corresponding to the first system identifier according to the user information;
[0091] A first creation module, used for creating a global session and saving the user information into the global session;
[0092] The second receiving module is used to receive a second access request, obtain a second system identifier in the second access request, and perform a login operation of the system corresponding to the second system identifier through the global session, wherein the first access request is an access request received when the global session is invalid, and the second access request is an access request received when the global session is valid.
[0093] This login management device generates a global session and saves user information at the first login, so that the user only needs to enter the user information at the first login. When logging into other systems subsequently, there is no need to enter the user information and can log in directly through the global session, thereby improving the user's login efficiency and enhancing the user experience.
[0094] It should be noted that the first receiving module in this embodiment can be used to execute step S10 in the embodiment of the present application, the first creating module in this embodiment can be used to execute step S20 in the embodiment of the present application, and the first receiving module in this embodiment can be used to execute step S30 in the embodiment of the present application.
[0095] Furthermore, the first receiving module includes:
[0096] A first sending unit, configured to send the user information and the first system identifier to an authentication server;
[0097] A first receiving unit, configured to receive a first authorization code returned by the authentication server based on the user information and the first system identifier;
[0098] A second sending unit, configured to send the first authorization code to the authentication server, so as to receive a first access token returned by the authentication server based on the first authorization code;
[0099] The first storage unit is used to store the first access token in a gateway.
[0100] Furthermore, the user information includes a user account, a password, and a permission category; and the first receiving unit includes:
[0101] The first receiving subunit is used to receive a first authorization code corresponding to the permission category, which is returned by the authentication server after the authentication server successfully performs identity authentication through the user account, password and the first system identifier.
[0102] Furthermore, the second receiving module includes:
[0103] A first acquisition unit, used to acquire user information and login status information in the global session, and determine whether the current login status is valid according to the login status information;
[0104] A third sending unit is used to send the second system identifier to the authentication server if the current login status is valid, and receive a second authorization code returned by the authentication server based on the second system identifier;
[0105] a fourth sending unit, configured to send the second authorization code to the authentication server, so as to receive a second access token returned by the authentication server based on the second authorization code;
[0106] The second storage unit is used to store the second access token in the gateway.
[0107] Furthermore, the first acquiring unit includes:
[0108] A first acquisition subunit is used to acquire a preset login time limit and acquire the login duration in the login status information;
[0109] A first judgment subunit is used to judge whether the login time is less than the preset login time limit;
[0110] The first execution subunit is used to verify that the current login state is valid if the login duration is less than the preset login time limit.
[0111] Furthermore, the first receiving module includes:
[0112] A second acquisition unit is used to acquire the external software identifier in the first access request, and return a login entry corresponding to the external software identifier, so that the user can log in and authorize the platform server corresponding to the external software identifier according to the login entry;
[0113] A second receiving unit, configured to receive a third access token and the user information returned by the platform server after completing the login authorization;
[0114] The first generating unit generates a fourth access token according to the third access token, the user information and the first system identifier, and saves the fourth access token to the gateway.
[0115] Furthermore, the login management device further includes:
[0116] A first clearing module, configured to clear the global session and the user information if a logout instruction including any system identifier is received, and determine whether there is a currently logged-in system;
[0117] The first exit module is used to exit the logged-in system if there is a logged-in system.
[0118] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be implemented by software or hardware, wherein the hardware environment includes a network environment.
[0119] Reference Figure 4 In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to the memory 20 and the communication module 10 respectively, and a computer program is stored in the memory 20. The computer program is executed by the processor 30 at the same time, and the steps of the above method embodiment are implemented when the computer program is executed.
[0120] The communication module 10 can be connected to an external communication device through a network. The communication module 10 can receive requests from an external communication device, and can also send requests, instructions and information to the external communication device, which can be other electronic devices, servers or Internet of Things devices, such as televisions, etc.
[0121] The memory 20 can be used to store software programs and various data. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as receiving a first access request), etc.; the data storage area can include a database, and the data storage area can store data or information created according to the use of the system, etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0122] The processor 30 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, so as to monitor the electronic device as a whole. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 30.
[0123] although Figure 4 Although not shown, the electronic device may further include a circuit control module, which is used to connect to a power source to ensure the normal operation of other components. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0124] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium may be Figure 4 The memory 20 in the electronic device may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The computer-readable storage medium includes a number of instructions for enabling a terminal device with a processor (which may be a television, a car, a mobile phone, a computer, a server, a terminal, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0125] In the present invention, the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0126] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0127] Although the embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art can change, modify and replace the above embodiments within the scope of the present invention, and these changes, modifications and replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A login management method, characterized in that: The method comprises: receiving a first access request, acquiring user information and a first system identifier corresponding to the first access request, and performing a login operation of a system corresponding to the first system identifier according to the user information; Creating a global session and saving the user information in the global session; receiving a second access request, obtaining a second system identifier in the second access request, and performing a login operation of a system corresponding to the second system identifier through the global session, wherein the first access request is an access request received when the global session is invalid, and the second access request is an access request received when the global session is valid; If an exit instruction including any system identifier is received, the global session and the user information are cleared, and it is determined whether there is a currently logged-in system; If there is a logged-in system, log out of the logged-in system; The step of performing a login operation of the system corresponding to the first system identifier according to the user information comprises: Sending the user information and the first system identifier to an authentication server; Receiving a first authorization code returned by the authentication server based on the user information and the first system identifier; Sending the first authorization code to the authentication server to receive a first access token returned by the authentication server based on the first authorization code; Saving the first access token to the gateway; The user information includes a user account, a password, and a permission category; the step of receiving a first authorization code returned by the authentication server based on the user information and the first system identifier includes: Receive a first authorization code corresponding to the permission category, which is returned by the authentication server after successfully performing identity authentication using the user account, password, and the first system identifier.
2. The login management method according to claim 1, characterized in that: The step of performing a login operation of the system corresponding to the second system identifier through the global session includes: Obtaining user information and login status information in the global session, and determining whether the current login status is valid according to the login status information; If the current login status is valid, sending the second system identifier to the authentication server, and receiving a second authorization code returned by the authentication server based on the second system identifier; Sending the second authorization code to the authentication server to receive a second access token returned by the authentication server based on the second authorization code; The second access token is saved to the gateway.
3. The login management method according to claim 2, characterized in that: The step of judging whether the current login status is valid according to the login status information comprises: Obtain the preset login time limit, and obtain the login duration in the login status information; Determine whether the login time is less than the preset login time limit; If the login duration is less than the preset login time limit, the current login status is valid.
4. The login management method according to claim 1, characterized in that: The step of obtaining user information and a first system identifier corresponding to the first access request, and performing a login operation on the system corresponding to the first system identifier according to the user information includes: Obtaining the external software identifier in the first access request, and returning a login entry corresponding to the external software identifier, so that the user can log in and authorize the platform server corresponding to the external software identifier according to the login entry; Receiving a third access token and the user information returned by the platform server after completing the login authorization; A fourth access token is generated according to the third access token, the user information and the first system identifier, and the fourth access token is saved to the gateway.
5. A login management device, characterized in that: The login management device comprises: A first receiving module is used to receive a first access request, obtain user information and a first system identifier corresponding to the first access request, and perform a login operation of the system corresponding to the first system identifier according to the user information; A first creation module, used for creating a global session and saving the user information into the global session; a second receiving module, configured to receive a second access request, obtain a second system identifier in the second access request, and perform a login operation of the system corresponding to the second system identifier through the global session, wherein the first access request is an access request received when the global session is invalid, and the second access request is an access request received when the global session is valid; A first clearing module, configured to clear the global session and the user information if a logout instruction including any system identifier is received, and determine whether there is a currently logged-in system; A first exit module, used for exiting the logged-in system if there is a logged-in system; The first receiving module comprises: A first sending unit, configured to send the user information and the first system identifier to an authentication server; A first receiving unit, configured to receive a first authorization code returned by the authentication server based on the user information and the first system identifier; A second sending unit, configured to send the first authorization code to the authentication server, so as to receive a first access token returned by the authentication server based on the first authorization code; A first storage unit, configured to store the first access token in a gateway; The user information includes a user account, a password, and a permission category; the first receiving unit includes: The first receiving subunit is used to receive a first authorization code corresponding to the permission category, which is returned by the authentication server after the authentication server successfully performs identity authentication through the user account, password and the first system identifier.
6. An electronic device, characterized in that: The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the login management method according to any one of claims 1 to 4 when executed by the processor.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the login management method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Single sign on method, computer readable storage medium and gateway
CN109413032A
Multi-service system access method and device and server
CN110311899A
Device id-based login state sharing method and device
WO2020155492A1