Login state maintenance method and apparatus

By generating initial and redirect tokens, the problem of login token expiration between multiple application systems is solved, enabling users to have a seamless login experience across multiple server systems.

CN116232754BActive Publication Date: 2026-03-13CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

When switching between multiple application systems, users may encounter login issues due to expired login tokens, leading to re-login problems and impacting user experience.

Method used

Generate an initial login token and a redirect token. Use the redirect token to maintain the user's login status when the user returns to the current server, thus avoiding the need to log in again.

Benefits of technology

It improves the smoothness and continuity of access between multiple server-side systems, enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232754B_ABST
    Figure CN116232754B_ABST
Patent Text Reader

Abstract

This invention discloses a login status maintenance method and apparatus, relating to the field of mobile internet technology. One specific embodiment of the method includes: after detecting that a user has successfully logged in for the first time on a current server, generating an initial login token for the user on the current server; in response to the user redirecting from the current server to a target server, generating a redirect token for the user indicating the redirection from the current server to the target server; when the user returns from the target server to the current server, determining whether the initial login token has expired; and if the initial login token has expired, maintaining the user's successful login status on the current server based on the redirect token. This embodiment can automatically maintain the successful login status when the user returns to the original server system, avoiding the user having to re-perform the login operation on the original server system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of mobile internet technology, and in particular to a method and apparatus for maintaining login status. Background Technology

[0002] Currently, the system services used by internet users are often provided by multiple application systems, and passwordless login is frequently required between these systems. After jumping from the current system to the target system, users may perform operations for a considerable period of time, which may cause the login token of the current system to become invalid without the user's knowledge. When it is necessary to return to the current system to perform operations, the user will have to log in again, resulting in interruption of the original access process and a deterioration in user experience. In addition, users are often unaware that they have crossed two different server-side systems, which objectively further affects the user experience. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a login status maintenance method and apparatus that can automatically maintain the login success status when the user returns to the original server system, thereby avoiding the user having to re-perform the login operation on the original server system.

[0004] To achieve the above objectives, according to one aspect of the present invention, a login status maintenance method is provided.

[0005] The login status maintenance method of this invention is executed by the current server; the method includes: after detecting that a user has successfully logged in to the current server for the first time, generating an initial login token for the user on the current server; in response to the user jumping from the current server to a target server, generating a jump token for the user indicating the jump from the current server to the target server; when the user returns from the target server to the current server, determining whether the initial login token has expired; if the initial login token has expired, maintaining the user's successful login status on the current server based on the jump token.

[0006] Optionally, the method further includes: after generating the initial login token for the user against the current server, storing the initial login token locally; after generating the redirect token, sending the generated redirect token to the user's client; and storing the redirect token locally on the client after it is received by the client.

[0007] Optionally, maintaining the user's successful login status on the current server based on the redirect token includes: obtaining the redirect token from the client, generating a new login token for the user on the current server based on the redirect token, and maintaining the user's successful login status on the current server based on the new login token.

[0008] Optionally, the initial login token and the new login token indicate the following information: the user's identifier, the identifier of the current server, a timestamp, and the user's digital signature; the redirect token indicates the following information: a preset redirect token marker, the user's identifier, indication information from the current server to the target server, a timestamp, and the user's digital signature.

[0009] Optionally, the initial login token and the new login token have a fixed validity period; for either the initial login token or the new login token, when the user is in a successful login state controlled by that token, the user's latest preset action triggers a reset of the token's validity period start time.

[0010] Optionally, determining whether the initial login token has expired includes: determining whether the current time is within the current validity period of the initial login token; if so, determining the initial login token as valid; otherwise, determining the initial login token as expired.

[0011] Optionally, obtaining the redirect token from the client includes: sending a redirect token acquisition notification to the client, carrying the user's identifier and indication information from the current server to the target server; after receiving the redirect token acquisition notification, the client determines the corresponding redirect token locally based on the user's identifier and indication information from the current server to the target server carried in the redirect token acquisition notification; and receives the redirect token sent by the client.

[0012] Optionally, the method further includes: after receiving the redirect token sent by the client, verifying whether the redirect token contains a preset redirect token marker, verifying whether the user identifier in the redirect token is the user's identifier, verifying whether the indication information in the redirect token matches the current server redirect path, and verifying whether the digital signature in the redirect token corresponds to the user; when all verifications pass, performing the step of generating a new login token for the user on the current server based on the redirect token; when any verification fails, canceling the user's successful login status on the current server and prompting the user to log in again.

[0013] Optionally, the redirect token has a fixed validity period, the validity period of which is longer than the validity period of the initial login token and the validity period of the new login token; and the method further includes: after receiving the redirect token sent by the client, further verifying whether the current time is within the validity period of the redirect token; when all verifications of the marker, user identifier, indication information, digital signature, and validity period in the redirect token pass, performing the step of generating a new login token for the user on the current server based on the redirect token; when any verification fails, canceling the user's successful login status on the current server and prompting the user to log in again.

[0014] Optionally, the method further includes: after generating a new login token for the user against the current server based on the redirect token, deleting the locally stored redirect token and sending a redirect token deletion notification to the client; wherein the redirect token deletion notification carries the user's identifier and indication information from the current server to the target server; after receiving the redirect token deletion notification, the client determines the corresponding redirect token locally based on the user's identifier and the indication information from the current server to the target server carried in the redirect token deletion notification and deletes it.

[0015] Optionally, the method further includes: after generating and storing the initial login token for the user against the current server locally, sending a first login token storage notification carrying the initial login token to the client, so that the client stores the initial login token locally; and after determining that the initial login token has expired, sending a login token deletion notification carrying the user's identifier and the identifier of the current server to the client, so that the client determines and deletes the locally stored initial login token according to the login token deletion notification.

[0016] Optionally, the method further includes: after generating a new login token for the user against the current server based on the redirect token, sending a second login token storage notification carrying the new login token to the client, so that the client stores the new login token locally.

[0017] To achieve the above objectives, according to another aspect of the present invention, a login status maintenance device is provided.

[0018] The login status maintenance device of this invention is installed in the current server; the device includes: an initial token generation unit, configured to: generate an initial login token for the user on the current server after detecting that the user has successfully logged in for the first time; a redirect token generation unit, configured to: generate a redirect token for the user indicating the redirection from the current server to the target server in response to the user redirecting from the current server to the target server; and a login maintenance unit, configured to: determine whether the initial login token has expired when the user returns from the target server to the current server; and maintain the user's successful login status on the current server based on the redirect token if the initial login token has expired.

[0019] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.

[0020] An electronic device according to the present invention includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the login status maintenance method provided by the present invention.

[0021] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.

[0022] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the login state maintenance method provided by the present invention.

[0023] To achieve the above objectives, according to another aspect of the present invention, a computer program product is provided.

[0024] A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements the login status maintenance method provided in an embodiment of the present invention.

[0025] According to the technical solution of the present invention, the embodiments described above have the following advantages or beneficial effects:

[0026] Based on the jump token generation and application mechanism of this invention, when a user jumps and returns between multiple server systems without logging in, it can avoid the situation where the user needs to log in again due to the failure of the login token between different server systems, thereby enhancing the smoothness and continuity of multi-server system connection and access and improving the user's access experience.

[0027] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0028] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0029] Figure 1 This is a schematic diagram of the main steps of the login status maintenance method in an embodiment of the present invention;

[0030] Figure 2 This is a schematic diagram of the first cross-server redirection and return in an embodiment of the present invention;

[0031] Figure 3 This is a schematic diagram of the second cross-server redirection and return in an embodiment of the present invention;

[0032] Figure 4 This is a schematic diagram of the components of the login status maintenance device in an embodiment of the present invention;

[0033] Figure 5 This is an exemplary system architecture diagram that can be applied thereto according to embodiments of the present invention;

[0034] Figure 6 This is a schematic diagram of the electronic device structure used to implement the login status maintenance method in the embodiments of the present invention. Detailed Implementation

[0035] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0036] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.

[0037] Figure 1 This is a schematic diagram of the main steps of the login status maintenance method according to an embodiment of the present invention.

[0038] like Figure 1 As shown, the login state maintenance method in this embodiment of the invention is executed by the current server. The current server can be any server system accessed by the user at the current moment. It can be the first server system among multiple server systems accessed by the user client in a sequential redirection manner, or any intermediate server system other than the last server system. The login state maintenance method in this embodiment of the invention can be specifically executed according to the following steps:

[0039] Step S101: After detecting that the user has successfully logged in to the current server for the first time, generate the user's initial login token for the current server.

[0040] In this embodiment of the invention, the initial login token refers to the login credential generated by the current server after the user's first login. Specifically, the initial login token can indicate the following information: the user's identifier, the current server's identifier, the corresponding timestamp, and the user's digital signature. After generating the initial login token, the current server stores it locally and sends a first login token storage notification carrying the initial login token to the client. Upon receiving the notification, the client stores the initial login token carried in the notification locally. Subsequently, the client can send the initial login token when accessing the current server to achieve passwordless login. In practical scenarios, the initial login token also has a fixed validity period to determine whether the token is valid or invalid at any given time. There are two ways to set the validity period. In the first method, the start time of the validity period is fixed at the token generation time and does not change due to user clicks, touches, or other actions. If the current time is outside the validity period, the token is invalid. In a more efficient approach, when a user is in a successfully logged-in state controlled by the initial login token, the user's latest preset action, such as clicking or touching, triggers a reset of the initial login token's validity period. In other words, the initial login token only becomes invalid if the user does not perform a preset action on the corresponding server system for an extended period. The following explanation primarily uses this latter approach. Similarly, the new login token, which will be described below, also contains information such as the user's identifier, the current server's identifier, a corresponding timestamp, and the user's digital signature. It also has a fixed validity period to determine whether the token is valid or invalid at any given time, and this validity period can also be set in either of the two ways described above.

[0041] Step S102: In response to the user's jump from the current server to the target server, generate a jump token for the user that indicates the jump from the current server to the target server.

[0042] In practical applications, after generating the above redirect token, the server can send the generated redirect token to the user's client. After the client receives the redirect token, it is stored locally on the client's machine.

[0043] In this step, when a user needs to redirect from the current server to the target server, the current server can temporarily generate a link to access the target server. Clicking this link will allow the user to access the target server. Alternatively, the user can trigger a preset button or control to access the target server. When the current server detects this redirection, it can generate a redirect token indicating the transition from the current server to the target server and send this token to the user's client. The client can then store the redirect token locally for later use.

[0044] In practical applications, the above redirect token can indicate the following information: a preset redirect token marker, the user's identifier, indication information from the current server to the target server, a timestamp, and the user's digital signature. This indication information may include the current server identifier, the target server identifier, and the redirection relationship between the two servers. Similarly, the above redirect token can also have a fixed validity period. To prevent the redirect token from becoming invalid due to cross-system redirection, its validity period can be configured to be longer than both the initial login token's validity period and the new login token's validity period.

[0045] Step S103: When the user returns from the target server to the current server, determine whether the initial login token has expired; if the initial login token has expired, maintain the user's successful login status on the current server based on the redirection token.

[0046] Preferably, the current server maintains the user's successful login status using the redirect token as follows: First, the server obtains the redirect token from the client, generates a new login token for the user on the current server based on the redirect token, and maintains the user's successful login status on the current server based on the new login token.

[0047] In this step, when the user returns from the target server to the current server, the current server first determines whether the initial login token has expired. Specifically, the current server checks whether the initial login token is currently within its validity period: if so, the initial login token is deemed valid; otherwise, it is deemed invalid. If the initial login token is valid, the current server maintains the user's successful login status and provides normal service to the user. If the initial login token has expired, the current server can send a login token deletion notification to the client, carrying the user's identifier and the current server's identifier, so that the client can determine and delete the locally stored initial login token based on the notification. Additionally, the current server can interact with the client to obtain a redirect token. Specifically, the current server sends a redirect token acquisition notification to the client, carrying the user's identifier and the indication information from the current server to the target server. After receiving the redirect token acquisition notification, the client determines the corresponding redirect token locally based on the user's identifier and the indication information from the current server to the target server carried in the notification and sends the redirect token to the current server.

[0048] As a preferred embodiment, upon receiving the redirect token from the client, the current server can first verify the correctness of the redirect token. Specifically, the current server verifies whether the redirect token contains a preset redirect token flag, whether the user identifier in the redirect token matches the corresponding user's identifier, whether the indication information in the redirect token matches the current server's redirect path, and whether the digital signature in the redirect token corresponds to the corresponding user. If all the above verifications pass, the current server executes the step of generating a new login token. If any of the above verifications fail, the current server cancels the user's successful login status on the current server and prompts the user to log in again. In one embodiment, after receiving the redirect token from the client, the current server, in addition to the above verifications, further verifies whether the current time is within the validity period of the redirect token, i.e., verifies the validity of the redirect token. If all verifications of the flag, user identifier, indication information, digital signature, and validity period in the redirect token pass, the current server executes the step of generating a new login token; if any verification fails, the current server cancels the user's successful login status on the current server and prompts the user to log in again.

[0049] In addition to generating a new login token, the server can maintain the user's successful login status on the current server based on the new login token. This avoids the need for the user to re-execute the login process, ensuring the continuity of user access and improving the user experience.

[0050] Preferably, after generating a new login token, the current server can delete the locally stored redirect token and send a redirect token deletion notification to the client. This notification carries the user's identifier and instructions on how to navigate from the current server to the target server. Upon receiving the notification, the client determines and deletes the corresponding redirect token based on the user's identifier and the instructions. This ensures the redirect token is for one-time use, preventing long-term storage on the client from interfering with the existing login token usage mechanism. After generating a new login token, the current server can also send a second login token storage notification to the client, allowing the client to store the new token locally for subsequent passwordless login to the current server.

[0051] Figure 2 This is a schematic diagram of the first cross-server redirection and return in an embodiment of the present invention. Figure 3 This is a schematic diagram of the second cross-server redirection and return in an embodiment of the present invention, as shown below. Figure 2 and Figure 3 Specific embodiments of the present invention will be described.

[0052] Figure 2 This demonstrates a scenario where a jump token is not used, such as... Figure 2 As shown, the server-side system typically uses the user's login token to control the user's login status. That is, it verifies the validity of the login token to determine the user's login status. If the login token is valid, the user is allowed to proceed to the next step; otherwise, the request is rejected, and the user is prompted to log in again and obtain a new login token. After a user successfully logs in to the current server and obtains an initial login token, they can perform relevant business operations. During this operation, it may be necessary to trigger a redirect to the target server. At this time, the current server generates a link to the target server based on the pre-agreed interface specifications and encryption methods. The user's client automatically accesses this link and is redirected to the target server. After the target server decrypts the link and verifies the interface, it generates a login token for the user on the target server. The user's login validity period and operation permissions on the target server are then managed and controlled through this login token. The two login tokens mentioned above often have different validity periods. Therefore, when a user returns to the current server from the target server, the login token of the target server may be valid, but the initial login token of the current server may have expired. In this case, the current server will automatically redirect to the login page and guide the user to log in again, which causes an interval in the user's operation and affects the user experience.

[0053] Figure 3 The process shown solves the above problems; see [link / reference]. Figure 3 When a user navigates from the current server to the target server, the current server automatically generates a redirect token and sends it to the client. This redirect token can have a relatively long validity period, but it is preferred to set it for one-time use. When the user returns to the current server from the target server, if the original login token on the current server has expired, it can obtain the new redirect token. After successful verification, a new login token is generated, and the client is notified to delete the old one, so that the user does not need to repeat the login process after returning from the target server.

[0054] According to the technical solution of the present invention, when a user switches between multiple server systems without logging in and returns, the user can avoid the situation where the user needs to log in repeatedly due to the inconsistency of login token management methods between different server systems, so that the switching between server systems is seamless for the user and improves the continuity of user operation and experience.

[0055] It should be noted that the collection, analysis, use, transmission, and storage of user personal information involved in the technical solution of this invention all comply with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, and are not shared, disclosed, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent unauthorized access to such personal information data, ensure that personnel authorized to access personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. Once this user personal information data is no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data. When used, including in certain related applications, user privacy is protected by de-identifying the data, for example, by removing specific identifiers (e.g., date of birth), controlling the amount or specificity of stored data (e.g., collecting location data at the city level rather than the specific address level), controlling how the data is stored, and / or other de-identification methods.

[0056] For the foregoing method embodiments, they are described as a series of actions for ease of description. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, and some steps may actually be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential for implementing the present invention.

[0057] To facilitate better implementation of the above-described solutions of the embodiments of the present invention, related apparatus for implementing the above-described solutions is also provided below.

[0058] Please see Figure 4As shown, the login status maintenance device 400 provided in this embodiment of the invention is set in the current server and may include: an initial token generation unit 401, a jump token generation unit 402, and a login maintenance unit 403.

[0059] The initial token generation unit 401 is configured to: generate an initial login token for the user on the current server after detecting that the user has successfully logged in for the first time on the current server; the redirect token generation unit 402 is configured to: generate a redirect token for the user indicating the redirection from the current server to the target server in response to the user redirecting from the current server to the target server; and the login retention unit 403 is configured to: determine whether the initial login token has expired when the user returns from the target server to the current server; and, if the initial login token has expired, maintain the user's successful login status on the current server based on the redirect token.

[0060] As a preferred embodiment, the initial token generation unit 401 may be further configured to: after generating the initial login token for the user against the current server, store the initial login token locally. The redirect token generation unit 402 may be further configured to: after generating the redirect token, send the generated redirect token to the user's client; the redirect token is received by the client and stored locally on the client. The login retention unit 403 may be further configured to: obtain the redirect token from the client, generate a new login token for the user against the current server based on the redirect token, and maintain the user's successful login status against the current server based on the new login token.

[0061] In this embodiment of the invention, the initial login token and the new login token indicate the following information: the user's identifier, the identifier of the current server, a timestamp, and the user's digital signature; the redirect token indicates the following information: a preset redirect token marker, the user's identifier, indication information from the current server to the target server, a timestamp, and the user's digital signature; the initial login token and the new login token have a fixed validity period; for either the initial login token or the new login token, when the user is in a successful login state controlled by that token, the user's latest preset action triggers a reset of the token's validity period start time.

[0062] In a specific application, the login retention unit 403 can be further used to: determine whether the current time is within the current validity period of the initial login token; if so, determine the initial login token as valid; otherwise, determine the initial login token as invalid; in the case of the invalid initial login token, send a redirect token acquisition notification carrying the user's identifier and indication information from the current server to the target server to the client, and receive the redirect token returned by the client; after receiving the redirect token acquisition notification, the client determines the redirect token to be returned locally based on the user's identifier and indication information from the current server to the target server carried in the redirect token acquisition notification.

[0063] In practical applications, the login retention unit 403 can be further configured to: after receiving the redirect token sent by the client, verify whether the redirect token contains a preset redirect token marker, verify whether the user identifier in the redirect token is the user's identifier, verify whether the indication information in the redirect token matches the current server redirect path, and verify whether the digital signature in the redirect token corresponds to the user; when all verifications pass, execute the step of generating a new login token for the user on the current server based on the redirect token; if any verification fails, cancel the user's successful login status on the current server and prompt the user to log in again.

[0064] Preferably, the redirect token has a fixed validity period, which is longer than the validity period of the initial login token and the new login token. The login retention unit 403 can be further configured to: after receiving the redirect token sent by the client, further verify whether the current time is within the validity period of the redirect token; when all verifications of the marker, user identifier, indication information, digital signature, and validity period in the redirect token pass, execute the step of generating a new login token for the user on the current server based on the redirect token; when any verification fails, cancel the user's successful login status on the current server and prompt the user to log in again.

[0065] In an optional technical solution, the login retention unit 403 may be further configured to: after generating a new login token for the user against the current server based on the redirect token, delete the locally stored redirect token and send a redirect token deletion notification to the client; wherein the redirect token deletion notification carries the user's identifier and indication information from the current server to the target server; after receiving the redirect token deletion notification, the client determines the corresponding redirect token locally based on the user's identifier and the indication information from the current server to the target server carried in the redirect token deletion notification and deletes it.

[0066] In one embodiment, the initial token generation unit 401 may be further configured to: after generating the initial login token for the user against the current server and storing it locally, send a first login token storage notification carrying the initial login token to the client, so that the client stores the initial login token locally.

[0067] Furthermore, in this embodiment of the invention, the login retention unit 403 may be further configured to: after determining that the initial login token has expired, send a login token deletion notification to the client carrying the user's identifier and the identifier of the current server, so that the client determines and deletes the initial login token stored locally based on the login token deletion notification; after generating a new login token for the user for the current server based on the redirect token, send a second login token storage notification carrying the new login token to the client, so that the client stores the new login token locally.

[0068] According to the technical solution of this embodiment of the invention, after detecting a user's successful first login, the current server generates an initial login token for the user on the current server and stores it locally. When the user jumps from the current server to the target server, the current server generates a jump token for the user, indicating the jump from the current server to the target server, and sends the generated jump token to the user's client; the jump token is received by the client and stored locally on the client. When the user returns from the target server to the current server, the current server determines whether the initial login token has expired; if the initial login token has expired, the current server obtains the jump token from the client, generates a new login token for the user on the current server based on the jump token, and maintains the user's successful login status on the current server based on the new login token. In this way, when a user jumps and returns between multiple server systems without logging in, it can avoid the situation where the user needs to log in again due to the login token expiration problem between different server systems, enhance the smoothness and continuity of multi-server system connection and access, and improve the user's access experience.

[0069] Figure 5 An exemplary system architecture 500 is shown that can be applied to the login state maintenance method or login state maintenance device of the present invention.

[0070] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, network 504, and server 505 (this architecture is merely an example; the components included in a specific architecture may be adjusted according to the specific application). Network 504 serves as the medium for providing a communication link between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0071] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications, such as instant messaging applications, can be installed on terminal devices 501, 502, and 503 (for example only).

[0072] Terminal devices 501, 502, and 503 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0073] Server 505 can be a server that provides various services, such as a backend server that supports instant messaging applications operated by users using terminal devices 501, 502, and 503 (for example only). The backend server can process received access requests and return the processing results (such as accessing a page - for example only) to terminal devices 501, 502, and 503.

[0074] It should be noted that the login status maintenance method provided in this embodiment of the invention is generally executed by server 505, and correspondingly, the login status maintenance device is generally set in server 505.

[0075] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0076] The present invention also provides an electronic device. The electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the login state maintenance method provided by the present invention.

[0077] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing an electronic device according to embodiments of the present invention. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.

[0078] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0079] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0080] In particular, according to the embodiments disclosed in this invention, the processes described in the above main step diagrams can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the main step diagrams. In the above embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit 601, it performs the functions defined in the system of this invention.

[0081] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0082] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0083] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an initial token generation unit, a jump token generation unit, and a login retention unit. The names of these units do not necessarily limit the specific unit; for example, the initial token generation unit may also be described as "a unit that provides an initial login token to the login retention unit."

[0084] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to perform the following steps: after detecting that a user has successfully logged in to the current server for the first time, generating an initial login token for the user on the current server; in response to the user jumping from the current server to a target server, generating a jump token for the user indicating the jump from the current server to the target server; when the user returns from the target server to the current server, determining whether the initial login token has expired; and if the initial login token has expired, maintaining the user's successful login status on the current server based on the jump token.

[0085] A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements the login state maintenance method of the present invention.

[0086] In the technical solution of this invention, after detecting a user's successful first login, the current server generates an initial login token for the user on the current server and stores it locally. When the user jumps from the current server to the target server, the current server generates a jump token for the user, indicating the jump from the current server to the target server, and sends the generated jump token to the user's client; the jump token is received by the client and stored locally on the client. When the user returns from the target server to the current server, the current server determines whether the initial login token has expired; if the initial login token has expired, the current server obtains the jump token from the client, generates a new login token for the user on the current server based on the jump token, and maintains the user's successful login status on the current server based on the new login token. In this way, when a user jumps and returns between multiple server systems without logging in, it can avoid the situation where the user needs to log in again due to the login token expiration problem between different server systems, enhance the smoothness and continuity of multi-server system connection and access, and improve the user's access experience.

[0087] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for maintaining login status, characterized in that, Executed by the current server; the method includes: After detecting that a user has successfully logged in to the current server for the first time, an initial login token for the user on the current server is generated. In response to the user's redirection from the current server to the target server, a redirection token is generated for the user, indicating the redirection from the current server to the target server. The redirection token indicates the following information: a preset redirection token marker, the user's identifier, indication information from the current server to the target server, a timestamp, and the user's digital signature. The indication information includes the current server identifier, the target server identifier, and the redirection relationship between the two servers. The redirection token is configured for one-time use. When the user returns from the target server to the current server, it is determined whether the initial login token has expired; if the initial login token has expired, the user's successful login status on the current server is maintained according to the redirection token.

2. The method according to claim 1, characterized in that, The method further includes: After generating the initial login token for the user against the current server, the initial login token is stored locally; After the redirect token is generated, it is sent to the user's client; the redirect token is received by the client and stored locally on the client.

3. The method according to claim 2, characterized in that, Maintaining the user's successful login status on the current server based on the redirection token includes: The redirection token is obtained from the client, and a new login token for the user on the current server is generated based on the redirection token. The user's successful login status on the current server is maintained based on the new login token.

4. The method according to claim 3, characterized in that, The initial login token and the new login token indicate the following information: the user's identifier, the current server's identifier, the timestamp, and the user's digital signature.

5. The method according to claim 4, characterized in that, The initial login token and the new login token have a fixed validity period. For either the initial login token or the new login token, when the user is in a successful login state controlled by that token, the user's latest preset action triggers a reset of the token's validity period start time.

6. The method according to claim 5, characterized in that, The step of determining whether the initial login token has expired includes: Determine whether the current moment is within the current validity period of the initial login token: if yes, determine that the initial login token is valid; otherwise, determine that the initial login token is invalid.

7. The method according to claim 5, characterized in that, Obtaining the redirect token from the client includes: Send a redirect token acquisition notification to the client, which carries the user's identifier and the indication information from the current server to the target server; after receiving the redirect token acquisition notification, the client determines the corresponding redirect token locally based on the user's identifier and the indication information from the current server to the target server carried in the redirect token acquisition notification. Receive the redirect token sent by the client.

8. The method according to claim 7, characterized in that, The method further includes: After receiving the redirect token sent by the client, the system verifies whether the redirect token contains a preset redirect token marker, whether the user identifier in the redirect token is the user's identifier, whether the indication information in the redirect token matches the current server redirect path, and whether the digital signature in the redirect token corresponds to the user. If all verifications pass, the step of generating a new login token for the user on the current server based on the redirect token is executed; if any verification fails, the user's successful login status on the current server is canceled, and the user is prompted to log in again.

9. The method according to claim 8, characterized in that, The redirect token has a fixed validity period, which is longer than the validity period of the initial login token and the validity period of the new login token. And, the method further includes: After receiving the redirect token sent by the client, further verify whether the current time is within the validity period of the redirect token; If all verifications of the marker, user identifier, instruction information, digital signature, and validity period in the redirect token pass, the step of generating a new login token for the user on the current server based on the redirect token is executed; if any verification fails, the user's successful login status on the current server is canceled, and the user is prompted to log in again.

10. The method according to claim 4, characterized in that, The method further includes: After generating a new login token for the user against the current server based on the redirect token, the redirect token stored locally is deleted, and a redirect token deletion notification is sent to the client; wherein, the redirect token deletion notification carries the user's identifier and indication information from the current server to the target server; After receiving the redirect token deletion notification, the client determines and deletes the corresponding redirect token locally based on the user's identifier and the indication information from the current server to the target server carried in the redirect token deletion notification.

11. The method according to claim 4, characterized in that, The method further includes: After generating the initial login token for the user against the current server and storing it locally, a first login token storage notification carrying the initial login token is sent to the client so that the client stores the initial login token locally. After determining that the initial login token has expired, a login token deletion notification carrying the user's identifier and the current server's identifier is sent to the client, so that the client can determine and delete the locally stored initial login token based on the login token deletion notification.

12. The method according to claim 4, characterized in that, The method further includes: After generating a new login token for the user against the current server based on the redirect token, a second login token storage notification carrying the new login token is sent to the client so that the client stores the new login token locally.

13. A login status maintenance device, characterized in that, The device is configured in the current server; the device includes: An initial token generation unit is used to: generate an initial login token for the user on the current server after detecting that the user has successfully logged in for the first time on the current server; A redirect token generation unit is configured to: in response to a user redirecting from the current server to a target server, generate a redirect token for the user indicating the redirection from the current server to the target server; the redirect token indicates the following information: a preset redirect token marker, the user's identifier, indication information from the current server to the target server, a timestamp, and the user's digital signature; the indication information includes the current server identifier, the target server identifier, and the redirection relationship between the two servers; the redirect token is configured for one-time use. The login retention unit is configured to: determine whether the initial login token has expired when the user returns from the target server to the current server; and, if the initial login token has expired, maintain the user's successful login status on the current server based on the redirection token.

14. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-12.

16. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Secure cross-domain login method, system and server

    CN112333198A

  • Unified login system and method for intelligent application warehouse

    CN115242403A