Cross-system access method and device based on session persistence
By adding a custom SESSIONID to the cookie and performing encryption and decryption processing, the problem of inconsistent user authentication sessions in complex large-scale platform applications is solved, and cross-system login-free access and security improvements are achieved.
Patent Information
- Application Number
- CN202410737490.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-15
AI Technical Summary
In complex large-scale platform applications, multiple technical frameworks lead to inconsistent user authentication sessions, causing users to log in repeatedly when accessing between different systems, affecting user experience and system security.
By adding a custom SESSIONID attribute to the client's cookie and using encryption algorithms to encrypt and decrypt it, cross-system transfer and authentication reuse of session status are achieved to avoid repeated logins.
It enables users to log-in-free access between different systems, improves user experience and system security, and reduces the need for repeated logins.
Smart Images

Figure CN118784274A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology and can also be used in the financial field, and in particular to a cross-system access method and device based on session retention. Background Art
[0002] In complex and large-scale platform applications, multiple technical frameworks are usually used. Due to historical reasons, service deployment methods are also diverse, involving both distributed deployment and centralized deployment. Clients access platform functions between multiple different technical framework systems. Most systems' user authentication sessions follow the system framework, and the cost of session consistency modification between different systems is high. If the application functions between systems are not modified to access each other, users will need to log in and authenticate repeatedly, and functions involving session dependencies are prone to abnormalities, resulting in a poor user experience when using platform functions.
[0003] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No description herein is admitted to be prior art by inclusion in this section. Summary of the invention
[0004] In order to solve at least one problem existing in the background technology, the present application provides a cross-system access method and device based on session persistence, which can utilize client storage mechanism technology to add a custom SESSIONID attribute in the cookie to transmit the user session login status of the same user in different systems, and at the same time encrypt and decrypt the custom SESSIONID attribute value in the cookie through an encryption algorithm to ensure authentication reuse and access security between client cross-system access, and avoid the need for repeated login authentication when the client accesses different systems.
[0005] An embodiment of the present invention provides a cross-system access method based on session persistence, the method comprising:
[0006] In response to receiving a login operation of the client in the first system, generating a session file according to the login operation, and performing an encryption operation on the session file;
[0007] Based on the encrypted session file, construct a cookie object file, and send the cookie object file to the client, wherein the cookie object file is used to save the encrypted session file;
[0008] In response to receiving an access request from the client in the second system, obtaining the cookie object file from the client and verifying the validity of the cookie object file;
[0009] In response to verifying that the cookie object file is valid, a decryption operation is performed on the cookie object file, and based on the decrypted cookie object file, it is determined whether to approve the access request, wherein in response to approving the access request, the client implements login-free access to the second system.
[0010] In some optional aspects of this embodiment, generating a session file according to the login operation includes:
[0011] According to the login operation, determine the user information of logging into the first system, and generate a session file ID corresponding to the user information;
[0012] The session file is generated according to the session file ID and the user information.
[0013] In some optional aspects of this embodiment, the performing the encryption operation on the session file includes:
[0014] Determining the number of encryption rounds of the encryption operation and the encryption round key of each round of the encryption operation;
[0015] Based on a preset encryption round function and an encryption round key of each round of the encryption operation, the session file is iteratively encrypted for the number of encryption execution rounds until the last round of encryption is completed.
[0016] In some optional methods of this embodiment, constructing a cookie object file based on the encrypted session file includes:
[0017] Determining a session attribute according to the encrypted file, wherein the session attribute is used to save the encrypted session file;
[0018] Determine the security attributes and life cycle attributes of the cookie object file;
[0019] The cookie object file is constructed according to the session attributes, security attributes and life cycle attributes.
[0020] In some optional aspects of this embodiment, the verifying the validity of the cookie object file includes:
[0021] Determine the maximum validity period of the cookie object file according to the life cycle attribute;
[0022] Determining a login time of the login operation and a request time of the access request;
[0023] The validity of the cookie object file is verified according to the login time, the request time and the maximum valid time, wherein:
[0024] In response to the difference between the request time and the login time being greater than the maximum valid time, verifying that the cookie object file is invalid;
[0025] In response to the difference between the request time and the login time being less than or equal to the maximum valid time, verifying that the cookie object file is valid.
[0026] In some optional aspects of this embodiment, the performing a decryption operation on the cookie object file includes:
[0027] Determining the number of decryption execution rounds of the decryption operation and the decryption round key of each round of the decryption operation;
[0028] Based on a preset decryption round function and a round key of each round of the decryption operation, the cookie object file is iteratively decrypted for the number of decryption execution rounds until the last round of decryption is completed.
[0029] In some optional aspects of this embodiment, determining whether to approve the access request based on the decrypted cookie object file includes:
[0030] Based on the decrypted cookie object file, obtaining the session file, wherein the session file stores user information corresponding to the client;
[0031] Determine whether to approve the access request based on the user information and a preset access whitelist of the second system, wherein:
[0032] In response to the user information matching the preset access whitelist, determining to approve the access request;
[0033] In response to the user information not matching the preset access whitelist, it is determined that the access request is not approved.
[0034] The embodiment of the present invention further provides a cross-system access device based on session retention, the device comprising:
[0035] an encryption module, configured to generate a session file in response to receiving a login operation of a client in the first system according to the login operation, and perform an encryption operation on the session file;
[0036] A cookie object construction module is configured to construct a cookie object file based on the encrypted session file and send the cookie object file to the client, wherein the cookie object file is used to store the encrypted session file;
[0037] a verification module, configured to, in response to receiving an access request from the client to the second system, obtain the cookie object file from the client and verify the validity of the cookie object file;
[0038] The access module is configured to, in response to verifying that the cookie object file is valid, perform a decryption operation on the cookie object file, and determine whether to approve the access request based on the decrypted cookie object file, wherein, in response to approving the access request, the client implements login-free access to the second system.
[0039] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned cross-system access method based on session persistence when executing the computer program.
[0040] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned cross-system access method based on session persistence are implemented.
[0041] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the above-mentioned cross-system access method based on session persistence are implemented.
[0042] The embodiment of the present invention provides a cross-system access method and device based on session persistence, which can use the client storage mechanism technology to add a custom SESSIONID attribute in the cookie to transmit the user session login status of the same user in different systems, and at the same time encrypt and decrypt the custom SESSIONID attribute value in the cookie through an encryption algorithm to ensure authentication reuse and access security between client cross-system accesses, and avoid the need for repeated login authentication for the client to access different systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0044] Figure 1 is an exemplary system architecture diagram to which the embodiments of the present invention can be applied;
[0045] Figure 2 This is one of the exemplary flow charts of the cross-system access method based on session persistence according to an embodiment of the present invention;
[0046] Figure 3 This is a second exemplary flow chart of a cross-system access method based on session persistence according to an embodiment of the present invention;
[0047] Figure 4 is a schematic diagram of an encryption operation according to an embodiment of the present invention;
[0048] Figure 5 This is a third exemplary flow chart of a cross-system access method based on session persistence according to an embodiment of the present invention;
[0049] Figure 6 This is a fourth exemplary flow chart of a cross-system access method based on session persistence according to an embodiment of the present invention;
[0050] Figure 7 This is a fifth exemplary flow chart of a cross-system access method based on session persistence according to an embodiment of the present invention;
[0051] Figure 8 A schematic diagram of a decryption operation according to an embodiment of the present invention;
[0052] Fig. 9 A schematic diagram of the structure of a cross-system access device based on session retention according to an embodiment of the present invention;
[0053] Fig.10 The present invention is a block diagram of an electronic device for implementing a cross-system access method and device based on session persistence provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0055] The information collected in the technical solution of this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0056] Provide users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0057] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0058] Session persistence: Session persistence refers to a mechanism on the load balancer that can identify the relevance of the interaction process between the client and the server, and ensure that a series of related access requests are allocated to one machine while performing load balancing.
[0059] Figure 1 An exemplary system architecture is shown to which an embodiment of the cross-system access method based on session persistence or the cross-system access device based on session persistence of the present application can be applied.
[0060] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0061] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be installed with various communication client applications, such as web browser applications, search applications or social platform software.
[0062] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices, including but not limited to clients such as smart phones, tablet computers, e-book readers, laptop computers, and desktop computers. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, to provide distributed services), or they can be implemented as a single software or software module. No specific limitation is made here.
[0063] The server 105 may be a server that provides various services, such as a background server that processes login operations or access requests made by users through the terminal devices 101, 102, and 103. The background server may analyze and process the acquired data such as login operations or access requests, and feed back the processing results (such as cookie object files) to the terminal devices 101, 102, and 103.
[0064] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0065] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0066] It should be noted that the cross-system access method based on session retention provided in the embodiment of the present application is generally executed by the server 105. Accordingly, the cross-system access device based on session retention is generally set in the server 105.
[0067] like Figure 2 As shown, an embodiment of the present invention provides a cross-system access method based on session persistence, the method comprising:
[0068] Step 10: In response to receiving a login operation of the client in the first system, generating a session file according to the login operation, and performing an encryption operation on the session file.
[0069] Step 20: construct a cookie object file based on the encrypted session file, and send the cookie object file to the client, wherein the cookie object file is used to save the encrypted session file;
[0070] Step 30: in response to receiving an access request from the client in the second system, obtaining the cookie object file from the client, and verifying the validity of the cookie object file;
[0071] Step 40: In response to verifying that the cookie object file is valid, a decryption operation is performed on the cookie object file, and based on the decrypted cookie object file, it is determined whether to approve the access request, wherein, in response to approving the access request, the client implements login-free access to the second system.
[0072] The embodiment of the present invention provides a cross-system access method based on session persistence, which can use the client storage mechanism technology to add a custom SESSIONID attribute in the cookie to transmit the user session login status of the same user in different systems, and at the same time encrypt and decrypt the custom SESSIONID attribute value in the cookie through an encryption algorithm to ensure the authentication reuse and access security between the client's cross-system access, and avoid the need for the client to repeatedly perform login authentication when accessing different systems.
[0073] Next, Figure 2 The steps are described in detail:
[0074] Step 10: In response to receiving a login operation of the client in the first system, generating a session file according to the login operation, and performing an encryption operation on the session file.
[0075] This step is intended for the execution of the cross-system access method (e.g. Figure 1 The server 105 shown in FIG. 1 generates a session file SESSIONID and performs an encryption operation on the SESSIONID file after receiving a login operation of the client in the A system, such as a user name and password entered in the A system.
[0076] In some optional embodiments of this embodiment, Figure 3 As shown, the session file is generated according to the login operation, including:
[0077] Step 101A: According to the login operation, determine the user information of the first system, and generate a session file ID corresponding to the user information.
[0078] Step 102A: Generate the session file according to the session file ID and the user information.
[0079] In a specific example, a user enters a user name and password to log in to the first system (such as system A). After the server successfully verifies the user's identity, it will generate a unique session identifier (session ID, i.e., session file ID). The server generates a session file based on the session identifier, which contains user login information, such as user ID, role permissions, etc., as well as relevant information such as session expiration time.
[0080] In some optional embodiments of this embodiment, Figure 3 As shown, the encryption operation performed on the session file includes:
[0081] Step 103A, determining the number of encryption execution rounds of the encryption operation and the encryption round key of each round of the encryption operation;
[0082] Step 104A: Based on a preset encryption round function and an encryption round key of each round of the encryption operation, the session file is iteratively encrypted for the number of encryption execution rounds until the last round of encryption is completed.
[0083] In a specific example, the preset number of encryption rounds is 32, and the encryption operation process is as follows: Figure 4 As shown, where:
[0084] Input plaintext data, after 32 (i=0,1,...,31) rounds of iteration, when i=0, the first round of transformation is performed, and it continues until i=31. The input 128-bit plaintext is divided into 4 groups of 32-bit data according to the bit position, represented as (X i ,X i+1 ,X i+2 ,X i+3 ), where X i (i=0,1,...,31) is 32-bit plaintext data. First, X i Keep it unchanged and change X i+1 ,X i+2 ,X i+3 and round key rk i XOR gets a 32-bit data as the input of the box transformation, expressed as sbox input =X i+1 ⊕X i+2 ⊕X i+3 ⊕rk i , where ⊕ represents XOR operation, rk i is the round key. Then, sbox input Split into 4 8-bit data, perform box transform operations on each, and combine the outputs of the 4 box transforms (each output is still 8 bits) into a 32-bit sbox output .
[0085] Then, the 32-bit sbox output Perform shift transformation operation. Perform 4 circular left shift operations, circularly shifting 2, 10, 18, and 24 bits respectively, to obtain 4 32-bit results, recorded as y2, y10, y18, and y24 respectively. Box transform the shift results y2, y10, y18, and y24 to output sbox output , the first group of input plaintext X i , XOR the three together to get X i+4 , denoted by X i+4 =sbox output ⊕y2⊕y10⊕y18⊕y24⊕X i .
[0086] In the actual encryption process, the above process is executed for 32 rounds, and each round uses a different round key rk i =K i+4 (i=0,1,...,31), the round key is generated by key expansion. The round function F finally generates 4 32-bit data X 32 , X 33 , X 34, X 35 After merging, perform the reverse transformation operation to obtain the final 128-bit ciphertext data, namely X 32 , X 33 , X 34, X 35 .
[0087] Step 20: construct a cookie object file based on the encrypted session file, and send the cookie object file to the client, wherein the cookie object file is used to save the encrypted session file.
[0088] This step is intended for the execution of the cross-system access method (e.g. Figure 1 The server 105 shown in FIG. 1 constructs a cookie object file based on the encrypted session file and sends the cookie object file to the client. For example, the server saves the generated session file in a temporary directory of the server, usually including a session identifier in the file name or using other methods to associate the session file with the user session; sends the session identifier to the client, and the server sends the session identifier to the client browser in a successful login response, usually by setting a cookie object file named "session ID"; after the client browser receives the session identifier, it automatically sends the identifier to the server in each subsequent request to maintain the session state.
[0089] In some optional embodiments of this embodiment, Figure 5 As shown, the cookie object file is constructed based on the encrypted session file, including:
[0090] Step 201: Determine session attributes according to the encrypted file, wherein the session attributes are used to save the encrypted session file.
[0091] In a specific example, the session attribute is a SESSIONID attribute, which is used to save an encrypted session file, which stores user information and password and login-related information.
[0092] Step 202: Determine the security attributes and life cycle attributes of the cookie object file.
[0093] In a specific example, the security attribute of the cookie object file is the HttpOnly attribute, which can prevent JavaScript scripts from accessing the cookie containing this attribute. By setting the cookie to HttpOnly, malicious scripts can be prevented from obtaining the user's cookie information through methods such as document.cookie, thereby improving the security of the website. This can effectively reduce the harm caused by cross-site scripting attacks (XSS).
[0094] In a specific example, the life cycle attribute of the cookie object file is the maxAge attribute, which refers to an attribute available when setting a cookie, which is used to specify the maximum survival time of the cookie in seconds. When the maxAge attribute is set to a positive number, it means that the cookie will expire after the specified number of seconds; when it is set to a negative number, it means that the cookie is a session cookie and will be deleted when the user closes the browser; when it is set to 0, it means that the cookie is deleted immediately. For example, the specific value of the maxAge attribute is set to sessionTimeout / 1000.
[0095] Step 203: construct the cookie object file according to the session attributes, security attributes and life cycle attributes.
[0096] This step aims to construct the cookie object file according to the session attributes, security attributes and life cycle attributes.
[0097] Step 30: In response to receiving an access request from the client to the second system, obtaining the cookie object file from the client and verifying the validity of the cookie object file.
[0098] This step is intended for the execution of the cross-system access method (e.g. Figure 1 After receiving the access request from the client in the second system (eg, system B), the server 105 shown in FIG. 1 obtains the cookie object file from the client and verifies the validity of the cookie object file.
[0099] In some optional embodiments of this embodiment, Figure 6 As shown, the verification of the validity of the cookie object file includes:
[0100] Step 301: Determine the maximum validity period of the cookie object file according to the life cycle attribute.
[0101] In this embodiment, according to the above discussion on the life cycle attribute, it can be known that the life cycle attribute determines the maximum validity period of the cookie object file, for example, 5 minutes.
[0102] Step 302: Determine the login time of the login operation and the request time of the access request.
[0103] In this embodiment, it is necessary to determine the user's login time in the first system and the request time when requesting access to the second system. For example, the login time is xxxx / xx / xx:10:20, and the request time is xxxx / xx / xx:13:20.
[0104] Step 303: Verify the validity of the cookie object file according to the login time, the request time and the maximum valid time, wherein:
[0105] In response to the difference between the request time and the login time being greater than the maximum valid time, verifying that the cookie object file is invalid;
[0106] In response to the difference between the request time and the login time being less than or equal to the maximum valid time, verifying that the cookie object file is valid.
[0107] It should be understood that when the difference between the request time and the login time is greater than the maximum valid time, it indicates that the cookie object file has expired, that is, the verification cookie object file is invalid, and the user-related login information stored in the cookie object file cannot be used in the access authentication of the second system; when the difference between the request time and the login time is less than or equal to the maximum valid time, it indicates that the cookie object file is still in the validity period, that is, the verification cookie object file is valid, and the user-related login information stored in the cookie object file can be used in the access authentication of the second system.
[0108] Step 40: In response to verifying that the cookie object file is valid, a decryption operation is performed on the cookie object file, and based on the decrypted cookie object file, it is determined whether to approve the access request, wherein, in response to approving the access request, the client implements login-free access to the second system.
[0109] This step is intended for the execution of the cross-system access method (e.g. Figure 1 The server 105 shown in the figure) when the client accesses system B from system A, after verifying that the cookie object file is valid, first performs a decryption operation on the cookie object file, and determines whether to approve the access request based on the decrypted cookie object file, wherein, in response to approving the access request, the client implements login-free access to the second system.
[0110] In some optional embodiments of this embodiment, Figure 7 As shown, the decryption operation on the cookie object file includes:
[0111] Step 401, determining the number of decryption execution rounds of the decryption operation and the decryption round key of each round of the decryption operation;
[0112] Step 402: Based on a preset decryption round function and a round key of each round of the decryption operation, the cookie object file is iteratively decrypted for the number of decryption execution rounds until the last round of decryption is completed.
[0113] In a specific example, the preset decryption round function is 32, and the decryption operation process is as follows: Figure 8 As shown, where:
[0114] Input ciphertext data. In the process of decrypting the ciphertext data, the same round function F as the encryption process is used. The round key used in each iteration is reversed. 32 rounds of nonlinear iteration mechanism are performed, and the original plaintext is finally output.
[0115] First, the input ciphertext (X32, X33, X34, X35) of the 0th round of operation is recorded as (X / 0, X / 1, X / 2, X / 3). Then the key is reversed, and the output of the last four rounds, i.e., rounds 28, 29, 30, and 31, is reversed to obtain the decrypted plaintext data (X0, X1, X2, X3).
[0116] In some optional embodiments of this embodiment, Figure 7 As shown, the determining whether to approve the access request based on the decrypted cookie object file includes:
[0117] Step 403: Based on the decrypted cookie object file, obtain the session file, wherein the session file stores user information corresponding to the client.
[0118] In this embodiment, user information corresponding to the client can be obtained based on the decrypted cookie object file.
[0119] Step 404: Determine whether to approve the access request based on the user information and the preset access whitelist of the second system, wherein:
[0120] In response to the user information matching the preset access whitelist, determining to approve the access request;
[0121] In response to the user information not matching the preset access whitelist, it is determined that the access request is not approved.
[0122] In this embodiment, after decryption is completed, the A system application retrieves the user credential information based on the session information stored in the custom SESSIONID attribute, and sends a verification request to the existing authentication information cache server, and the authentication information cache server performs a login verification based on the user information. The login verification is, for example, matching the user information with the preset access whitelist of the B system:
[0123] When the user information matches the preset access whitelist, that is, the user information is in the preset whitelist of allowed access in system B, the verification is successful, the user's access request is released, and the page corresponding to the application function of system B is jumped to continue the subsequent service request operation, thus realizing cross-system login-free authentication access.
[0124] When the user information does not match the preset access whitelist, that is, the user information is not in the preset whitelist of allowed access in system B, the verification fails, the user's access request is not released, and the page jumps to the user login page, requiring the user to log in again, thereby improving the security of system access.
[0125] The core of the present invention is to utilize the client storage mechanism to add a custom SESSIONID attribute in the cookie object to maintain the validity of the same user session login status under different technical frameworks when the client accesses. In terms of security, the custom SESSIONID attribute value in the cookie object is encrypted and decrypted by an encryption algorithm; the HttpOnly attribute of the cookie object is set to read-only to ensure the security of access between systems; without changing the original system architecture, the user information stored in the SESSIONID attribute value is logged in with the help of the existing user login credential cache server, and the user is released if the verification passes, so as to realize the mutual use of user login information for cross-system access and no longer need to repeatedly visit the unified authentication center.
[0126] Based on the same inventive concept, the embodiment of the present invention also provides a cross-system access device based on session persistence, as described in the following embodiment. Since the principle of solving the problem by the device is similar to that of the cross-system access method based on session persistence, the implementation of the device can refer to the implementation of the cross-system access method based on session persistence, and the repeated parts will not be repeated.
[0127] like Fig. 9 As shown, the cross-system access device based on session retention includes:
[0128] The encryption module 601 is configured to generate a session file in response to receiving a login operation of the client in the first system according to the login operation, and perform an encryption operation on the session file;
[0129] A cookie object construction module 602 is configured to construct a cookie object file based on the encrypted session file and send the cookie object file to the client, wherein the cookie object file is used to store the encrypted session file;
[0130] The verification module 603 is configured to obtain the cookie object file from the client in response to receiving an access request from the client in the second system, and verify the validity of the cookie object file;
[0131] The access module 604 is configured to, in response to verifying that the cookie object file is valid, perform a decryption operation on the cookie object file, and determine whether to approve the access request based on the decrypted cookie object file, wherein, in response to approving the access request, the client implements login-free access to the second system.
[0132] In some optional aspects of this embodiment, the encryption module includes a session file generation unit and an encryption unit, wherein:
[0133] The session file generation unit is configured to:
[0134] According to the login operation, determine the user information of logging into the first system, and generate a session file ID corresponding to the user information;
[0135] The session file is generated according to the session file ID and the user information.
[0136] The cryptographic unit is configured as:
[0137] Determining the number of encryption rounds of the encryption operation and the encryption round key of each round of the encryption operation;
[0138] Based on a preset encryption round function and an encryption round key of each round of the encryption operation, the session file is iteratively encrypted for the number of encryption execution rounds until the last round of encryption is completed.
[0139] In some optional aspects of this embodiment, the cookie object construction module is further configured as follows:
[0140] Determining a session attribute according to the encrypted file, wherein the session attribute is used to save the encrypted session file;
[0141] Determine the security attributes and life cycle attributes of the cookie object file;
[0142] The cookie object file is constructed according to the session attributes, security attributes and life cycle attributes.
[0143] In some optional aspects of this embodiment, the verification module is further configured to:
[0144] Determine the maximum validity period of the cookie object file according to the life cycle attribute;
[0145] Determining a login time of the login operation and a request time of the access request;
[0146] The validity of the cookie object file is verified according to the login time, the request time and the maximum valid time, wherein:
[0147] In response to the difference between the request time and the login time being greater than the maximum valid time, verifying that the cookie object file is invalid;
[0148] In response to the difference between the request time and the login time being less than or equal to the maximum valid time, verifying that the cookie object file is valid.
[0149] In some optional aspects of this embodiment, the access module includes a decryption unit and an access unit, wherein:
[0150] The decryption unit is configured as:
[0151] Determining the number of decryption execution rounds of the decryption operation and the decryption round key of each round of the decryption operation;
[0152] Based on a preset decryption round function and a round key of each round of the decryption operation, the cookie object file is iteratively decrypted for the number of decryption execution rounds until the last round of decryption is completed.
[0153] The access unit is configured as:
[0154] Based on the decrypted cookie object file, obtaining the session file, wherein the session file stores user information corresponding to the client;
[0155] Determine whether to approve the access request based on the user information and a preset access whitelist of the second system, wherein:
[0156] In response to the user information matching the preset access whitelist, determining to approve the access request;
[0157] In response to the user information not matching the preset access whitelist, it is determined that the access request is not approved.
[0158] It should be noted that the cross-system access method and device based on session persistence provided in the embodiments of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiments of the present invention do not limit the application field of the cross-system access method and device based on session persistence.
[0159] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product, wherein:
[0160] An electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the cross-system access method based on session persistence of the aforementioned embodiment.
[0161] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the cross-system access method based on session persistence of the aforementioned embodiment.
[0162] A computer program product includes a computer program. When the computer program is executed by a processor, the cross-system access method based on session retention of the above embodiment is implemented.
[0163] Fig.10 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0164] like Fig.10 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0165] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0166] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as a cross-system access method based on session retention. For example, in some embodiments, a cross-system access method based on session retention may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the cross-system access method based on session retention described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured in any other appropriate manner (for example, by means of firmware) to execute the cross-system access method based on session persistence of the aforementioned embodiment.
[0167] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0168] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0169] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0170] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0171] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0172] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0173] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0174] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0177] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A cross-system access method based on session persistence, characterized in that: include: In response to receiving a login operation of the client in the first system, generating a session file according to the login operation, and performing an encryption operation on the session file; Based on the encrypted session file, construct a cookie object file, and send the cookie object file to the client, wherein the cookie object file is used to save the encrypted session file; In response to receiving an access request from the client in the second system, obtaining the cookie object file from the client and verifying the validity of the cookie object file; In response to verifying that the cookie object file is valid, a decryption operation is performed on the cookie object file, and based on the decrypted cookie object file, it is determined whether to approve the access request, wherein in response to approving the access request, the client implements login-free access to the second system.
2. The method according to claim 1, characterized in that: The step of generating a session file according to the login operation includes: According to the login operation, determine the user information of logging into the first system, and generate a session file ID corresponding to the user information; The session file is generated according to the session file ID and the user information.
3. The method according to claim 1, characterized in that The performing of encryption operation on the session file comprises: Determining the number of encryption rounds of the encryption operation and the encryption round key of each round of the encryption operation; Based on a preset encryption round function and an encryption round key of each round of the encryption operation, the session file is iteratively encrypted for the number of encryption execution rounds until the last round of encryption is completed.
4. The method according to claim 1, characterized in that: The method of constructing a cookie object file based on the encrypted session file includes: Determining a session attribute according to the encrypted file, wherein the session attribute is used to save the encrypted session file; Determine the security attributes and life cycle attributes of the cookie object file; The cookie object file is constructed according to the session attributes, security attributes and life cycle attributes.
5. The method according to claim 4, characterized in that The verification of the validity of the cookie object file includes: Determine the maximum validity period of the cookie object file according to the life cycle attribute; Determining a login time of the login operation and a request time of the access request; The validity of the cookie object file is verified according to the login time, the request time and the maximum valid time, wherein: In response to the difference between the request time and the login time being greater than the maximum valid time, verifying that the cookie object file is invalid; In response to the difference between the request time and the login time being less than or equal to the maximum valid time, verifying that the cookie object file is valid.
6. The method according to claim 1, characterized in that The performing a decryption operation on the cookie object file comprises: Determining the number of decryption execution rounds of the decryption operation and the decryption round key of each round of the decryption operation; Based on a preset decryption round function and a round key of each round of the decryption operation, the cookie object file is iteratively decrypted for the number of decryption execution rounds until the last round of decryption is completed.
7. The method according to claim 1, characterized in that The determining whether to approve the access request based on the decrypted cookie object file includes: Based on the decrypted cookie object file, obtaining the session file, wherein the session file stores user information corresponding to the client; Determine whether to approve the access request based on the user information and a preset access whitelist of the second system, wherein: In response to the user information matching the preset access whitelist, determining to approve the access request; In response to the user information not matching the preset access whitelist, it is determined that the access request is not approved.
8. A cross-system access device based on session retention, characterized in that: include: an encryption module, configured to generate a session file in response to receiving a login operation of a client in the first system according to the login operation, and perform an encryption operation on the session file; A cookie object construction module is configured to construct a cookie object file based on the encrypted session file and send the cookie object file to the client, wherein the cookie object file is used to store the encrypted session file; a verification module, configured to, in response to receiving an access request from the client to the second system, obtain the cookie object file from the client and verify the validity of the cookie object file; The access module is configured to, in response to verifying that the cookie object file is valid, perform a decryption operation on the cookie object file, and determine whether to approve the access request based on the decrypted cookie object file, wherein, in response to approving the access request, the client implements login-free access to the second system.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of a cross-system access method based on session persistence as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a cross-system access method based on session retention as described in any one of claims 1 to 7 are implemented.
11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of a cross-system access method based on session retention as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method, system and device for implementing single sign-on
CN102857484A
Method and system for maintaining login state of user account
CN103532919A
Synchronization method and system for cross-application session information
CN103795767A
Single-point login method and system and electronic device
CN107347068A
Mobile application unified login method and device
CN111814133A
