User management method, terminal device, and computer-readable storage medium

By determining user session expiration on the front end and using a JavaScript software development kit to proxy the OAuth process, the problem of lack of unified handling for user management in the back-end management system is solved, thereby reducing development and maintenance costs.

CN117768526BActive Publication Date: 2026-11-27CHINA MERCHANTS FINANCE HLDG CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311526050.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-15
Publication Date
2026-11-27
Estimated Expiration
2043-11-15

AI Technical Summary

Technical Problem

The lack of a unified approach to user management in existing back-end management systems means that each system needs to be developed and maintained independently, increasing development and maintenance costs.

Method used

By determining whether a user session has expired on the front end and using a JavaScript SDK to proxy the OAuth process to obtain an access authorization code to reactivate the user session, backend configuration and settings are reduced.

Benefits of technology

Managing user sessions on the front end reduces backend configuration and setup, lowers development and maintenance costs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117768526B_ABST
    Figure CN117768526B_ABST
Patent Text Reader

Abstract

The application discloses a user management method, a terminal device and a computer readable storage medium. The method comprises the following steps: when a page acquisition request for a subsystem is received, it is judged whether a user session corresponding to the page acquisition request is expired; if the user session is expired, a transfer page is received, and an access authorization code of the transfer page is acquired; and the user session is reactivated according to the access authorization code. The background management system does not uniformly process the user management, so that when the background management system is used, a large number of configurations and settings need to be performed in the background, the cost is high, and the development and maintenance cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of business system management technology, and in particular to user management methods, terminal devices and computer-readable storage media. Background Technology

[0002] Backend management systems are a crucial part of software development, used to manage and maintain the backend operations and configurations of various business systems. User management, as an important component of the backend management system, is responsible for managing user accounts, permissions, and roles, and is key to ensuring the system's security and stable operation.

[0003] However, some backend management systems on the market do not provide a unified approach to user management. Each development team may implement user management functions according to its own needs and technology stack, resulting in each system needing to independently develop and maintain user management functions, requiring a lot of configuration and settings on the backend, leading to high costs. Summary of the Invention

[0004] This application provides a user management method, a terminal device, and a computer-readable storage medium, which solves the problem of high development costs caused by the lack of unified user management in the back-end management system, and achieves the effect of reducing development and maintenance costs.

[0005] This application provides a user management method, which includes:

[0006] Upon receiving a page retrieval request for a subsystem, determine whether the user session corresponding to the page retrieval request has expired;

[0007] If the user session expires, receive the relay page and obtain the access authorization code for the relay page;

[0008] The user session is reactivated based on the access authorization code.

[0009] Optionally, after the step of determining whether the user session corresponding to the page retrieval request has expired, the following steps are included:

[0010] If the user session expires, retrieve the OAuth return value according to the OAuth process proxied by the JavaScript SDK;

[0011] The user login status corresponding to the user session is determined based on the return value.

[0012] Update the transit page based on the user's login status.

[0013] Optionally, the step of updating the transit page based on the user's login status includes:

[0014] When the status value in the return value is 0, it indicates that the user is logged in, and the access authorization code is updated to the transit page.

[0015] When the status value in the returned value is 1, it indicates that the user is offline and will be redirected to the login page.

[0016] Optionally, the step of receiving a page retrieval request for a subsystem includes:

[0017] Intercept the initial link of the page acquisition request, modify the request header of the initial link, and obtain the access authorization code;

[0018] Based on the client identifier, the access authorization code, and the initial link, generate the link corresponding to the page retrieval request.

[0019] Optionally, before the step of determining whether the user session corresponding to the page retrieval request has expired upon receiving a page retrieval request for the subsystem, the method includes:

[0020] Import the JavaScript software development kit and initialize the software development kit;

[0021] Upon receiving a user login request, the authentication and authorization methods of the software development kit are invoked;

[0022] After authentication and authorization are completed, the authentication and authorization results are received, a callback function is generated, and the authentication and authorization results are saved.

[0023] Optionally, the step of reactivating the user session based on the access authorization code includes:

[0024] Send the access authorization code to the backend server;

[0025] Receive the response result returned by the backend server, and activate the user session or prompt the user that the access failed based on the response result.

[0026] Optionally, the step of determining whether the user session corresponding to the page retrieval request has expired includes:

[0027] Periodically send user session verification requests to the backend server;

[0028] Based on the received response information, determine whether the user session has expired.

[0029] Optionally, after the step of reactivating the user session based on the access authorization code, the following steps are included:

[0030] Obtain the authentication information corresponding to the user session;

[0031] Obtain the page retrieval request and add the authentication information to the request header of the page retrieval request.

[0032] In addition, to achieve the above objectives, embodiments of the present invention also provide a terminal device, including a memory, a processor, and a user management program stored in the memory and executable on the processor. When the processor executes the user management program, it implements the method described above.

[0033] In addition, to achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium storing a user management program, which, when executed by a processor, implements the method described above.

[0034] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0035] Upon receiving a page retrieval request for a subsystem, the system determines whether the user session corresponding to the request has expired. If expired, the user session is reactivated using the access authorization code received from the transit page. In other words, when a local session expires but the global session has not, the local session can be reactivated on the front end using the access authorization code, eliminating the need for backend processing. This reduces backend configuration and setup, lowering development costs. Attached Figure Description

[0036] Figure 1 This is a flowchart illustrating an embodiment of the user management method of this application;

[0037] Figure 2 This is a flowchart of the user management method for this application.

[0038] Figure 3 This is a flowchart illustrating Embodiment 2 of the user management method of this application;

[0039] Figure 4 This is a schematic diagram of the terminal structure of the hardware operating environment involved in one embodiment of this application. Detailed Implementation

[0040] To address the issue of high costs resulting from extensive backend configuration and settings in management systems lacking unified user management, this application provides a user management method. Upon receiving a page retrieval request for a subsystem, the method checks if the corresponding user session has expired. If expired, a redirect page is received. The user session is then reactivated based on the access authorization code from the redirect page. User login is completed on the frontend, reducing backend configuration and settings and lowering development costs.

[0041] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0042] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0043] Example 1

[0044] User management is a crucial component of backend management systems. When a backend management system connects multiple subsystems, without a unified approach to user management, each subsystem needs to independently develop its own user management module, leading to redundant investment and development. Alternatively, even if user management is unified, failing to encapsulate the user management functionality into a software development kit (SDK) prevents developers from directly calling the SDK's interfaces and methods to implement user registration, login, and authentication functions, resulting in high integration costs. To address these issues, this embodiment provides a user management method.

[0045] Reference Figure 1 The user management method in this embodiment includes the following steps:

[0046] Step S100: Upon receiving a page retrieval request for a subsystem, determine whether the user session corresponding to the page retrieval request has expired;

[0047] In this embodiment, after a user logs into the main system, when accessing a subsystem page through the main system, if the user session has not expired, the user can access the subsystem page normally; if the user session has expired, the user needs to log in again.

[0048] As an alternative implementation, determining whether a user session has expired via the frontend can reduce backend configuration. Frontend determination of user session expiration can be based on the server's response status code or response data, or it can be achieved using a frontend timer to check if the current user session has expired.

[0049] For example, after the frontend sends a page retrieval request, the server can return different response status codes based on the validity of the user session. For instance, when the session expires, the server can return a 401 status code. In the frontend code, the user session's validity can be determined by checking the response status code. Besides response status codes, the server can also return other data to indicate the validity of the user session. For example, the server can return a JSON object containing the session state, and the frontend can use the attribute values ​​in this object to determine if the user session has expired. The frontend can also use timers to periodically check the validity of the user session, such as sending a request to the server at regular intervals to verify the user session. If the server returns a session expiration flag, the frontend then executes the corresponding steps.

[0050] As an alternative implementation, when using the OAuth process, modifying the XMLHttpRequest object and intercepting HTTP requests allows adding necessary authentication information to the HTTP requests. OAuth is an authorization mechanism that allows users to authorize third-party applications to access their protected resources. To complete an OAuth process, a third-party application needs to obtain authorization or an access token by sending an HTTP request to an authorization server. Therefore, to ensure that each request contains correct authentication information during the OAuth process, upon receiving a page retrieval request for a subsystem, the initial link of the page retrieval request is intercepted, and the request header of the initial link is modified to obtain an access authorization code. Then, based on the client identifier, the access authorization code, and the initial link, a link corresponding to the page retrieval request is generated; this link is the one with the added request header.

[0051] For example, during the process of intercepting a request on the front end and modifying the request headers to add authentication information, an XMLHttpRequest object is used to listen for and intercept the request received by the page. After intercepting the request, the request headers are modified to add authentication information. Request headers are typically contained in the headers field of an HTTP request, and the setRequestHeader method is used to set the request headers. After modifying the request headers, the modified request headers are concatenated with the initial link to generate a new access link.

[0052] As another alternative implementation method, refer to Figure 2When a user session expires, the JavaScript SDK (Software Development Kit) is executed to proxy the OAuth process. This allows the front-end to determine the user's global login status and execute corresponding steps, simplifying the back-end processing. Therefore, it is necessary to introduce and initialize the JavaScript SDK. Upon receiving a user login request, the authentication and authorization methods of the JavaScript SDK are called. After authentication and authorization are completed, the authentication and authorization results are received, a callback function is generated, and the authentication and authorization results are saved.

[0053] For example, a JavaScript software development kit (SDK) provided by a third-party platform can be imported into the front-end page. This can be done via CDN or by downloading the SDK file to the local machine and importing it. After the page loads, the SDK is initialized using its provided initialization methods. When the user clicks the login button or performs an authentication and authorization operation, the authentication and authorization methods provided by the SDK are called. These methods will open a pop-up window or redirect to the third-party platform's authentication and authorization page. After authentication and authorization are completed, the third-party platform will return the authentication and authorization results to the front-end page via a callback link. The front-end page needs to implement a callback handling function to receive and process the callback information. Within the callback handling function, the authentication and authorization results, such as access tokens and refresh tokens, can be obtained. This information can be saved to local storage or cookies for later use.

[0054] Step S200: If the user session expires, receive the relay page and obtain the access authorization code of the relay page;

[0055] In this embodiment, when a user session expires, the user is automatically redirected to a transit page, which displays different content based on the user's global session login status. A global session refers to the user's login session in the overall system, while a user session is a local session, unique to the subsystem.

[0056] As an optional implementation method, refer to Figure 2 After the JavaScript SDK acts as a proxy for the OAuth process, it will receive the OAuth return value. Different return values ​​represent different global session login states.

[0057] For example, when the received return value has a status value of 0, it indicates that the current global session is logged in, and the relay page includes status value 0 and access authorization code. When the received return value has a status value of 1, it indicates that the current global session is offline, and the relay page includes status value 1 and login page address.

[0058] As an alternative implementation, some systems, to ensure security, force the global session to expire after a user has been logged in for a period of time without any detected user activity. Alternatively, the current global session may expire if a user logs in with the same account on another device or browser. The global session may also be lost if the server restarts or experiences an anomaly. When OAuth returns a status value of 1, it indicates that the global session has expired, and the user is redirected to the login page. The global session is then activated upon user login, and the user is redirected to the business system. By using a JavaScript SDK to proxy the OAuth process, backend configuration and settings are reduced, allowing more authentication and authorization logic to be handled on the frontend. This way, each backend management system only needs to integrate the OAuth service provider's JavaScript SDK to implement user authentication and authorization functions, reducing development and maintenance workload. Simultaneously, users can complete login and session management on the frontend page, improving the user experience.

[0059] For example, when a user accesses the business system, the front-end page can check if the user is already logged in or if their session has expired. If the user is not logged in or their session has expired, the front-end page can call the OAuth service provider's JavaScript SDK method to trigger the user login process. The OAuth service provider's JavaScript SDK will pop up a window where the user enters their username and password to log in and authorize the backend management system to access their user information. After verifying the user's identity, the OAuth service provider will generate an access token and return it to the front-end page. The front-end page can save the access token locally and add it to the request header or request parameters each time it requests the backend management system. If this is the user's first login, the front-end page can send the user information returned by OAuth to the backend management system, and the business system's backend management system will create a local user account. The front-end page can use local storage or cookies to manage the user's session to maintain the user's login status. When the global session expires, the front-end page can call the OAuth service provider's JavaScript SDK method again to trigger the user's re-login process.

[0060] Step S300: Reactivate the user session according to the access authorization code.

[0061] In this embodiment, the access authorization code is used to send a request to the OAuth service provider to obtain an access token and a refresh token, thereby activating the user session. After activating the user session, authentication information such as the access token or letter token is obtained, and the authentication information is re-added to the request header of the page retrieval request, so that the page retrieval request can be replayed after the user session is activated.

[0062] As an optional implementation, after obtaining the access authorization code, the access authorization code is sent to the backend server, and then the response result returned by the backend server is received. Based on the response result, the user session is activated or the user is notified that access has failed.

[0063] For example, in the front-end page, an access authorization code is sent to the back-end server. Upon receiving the authorization code, the back-end server uses it to send a request to the OAuth service provider to obtain an access token and a refresh token. The OAuth service provider verifies the validity of the authorization code and returns the access token and refresh token to the back-end server. The back-end server stores the access token on the server side and returns a response to the front-end page. After receiving the response, the front-end page can save the access token in local storage or a cookie for use in subsequent API requests. This allows the front-end page to use the access authorization code to activate a partial user session and stores the access token on the front-end for use in subsequent API requests. This enables user session management while reducing dependence on and configuration of the back-end.

[0064] As an alternative implementation, after sending the access authorization code to the backend, the backend may fail to respond due to insufficient permissions, incorrect request parameters, business logic errors, or third-party service errors. When the backend fails to respond, the frontend can handle the situation accordingly based on the specific reason for the failure.

[0065] For example, if a request fails due to a temporary network or server issue, the frontend can provide a retry option, allowing the user to retry the request. Since access to some systems requires certain user permissions, insufficient permissions may cause the backend to return a failed response. When a user session is interrupted due to insufficient permissions, the corresponding response information is returned, and the connection is not re-established. The specific handling methods and steps for backend response failures may vary depending on the application's needs and actual circumstances. In actual development, an appropriate handling method can be selected based on specific business requirements and user experience considerations.

[0066] In this embodiment, upon receiving a page retrieval request for a subsystem, it is determined whether the user session corresponding to the page retrieval request has expired. If expired, the user session is reactivated based on the access authorization code received in the transit page. By performing the user session reactivation action on the front end, the configuration work on the back end by developers can be reduced, thus reducing costs.

[0067] Example 2

[0068] Based on Embodiment 1, another embodiment of this application is proposed, with reference to... Figure 3 After determining whether the user session corresponding to the page retrieval request has expired, the following steps are included:

[0069] Step S110: If the user session expires, obtain the OAuth return value according to the OAuth process proxied by the JavaScript SDK;

[0070] In this embodiment, OAuth is an open standard for authorizing access to protected resources. It allows users to authorize third-party applications to access their resources on another service provider without sharing their usernames and passwords. The return value of OAuth includes a status code and an access authorization code or webpage link associated with that status code.

[0071] As an optional implementation, this embodiment uses the OAuth 2.0 process to complete the authorization service. The client sends an authorization request to the authorization server, including the client's code, redirect link, and the scope of the request. The authorization server verifies the user's identity and displays an authorization page to the user, requesting authorization. After the user agrees to the authorization, the authorization server redirects the user to a pre-configured redirect link on the client, attaching an authorization code. Upon receiving the authorization code, the client uses it to send a token request to the authorization server, including the client's code, client key, authorization code, and redirect link. The authorization server verifies the validity of the authorization code and client information, and issues an access token and a refresh token to the client. The client uses the access token to send a request to the resource server, requesting access to protected resources. The resource server verifies the validity of the access token and decides whether to allow the client to access the resources based on the access token's permissions. After receiving the response from the resource server, the client obtains the required resources.

[0072] For example, in the front-end application, the appropriate Software Development Kit (SDK) is used to initialize the OAuth configuration, including client-side encoding, redirect links, and request scope. When OAuth authorization is required, a method provided by the SSD is invoked to initiate an authorization request. The SSD redirects the user to the authorization server, passing the appropriate parameters. The user authenticates and authorizes on the authorization server. After the user completes the authorization process, the authorization server redirects the user back to the pre-configured redirect link, along with a return value such as an access authorization code or access token. At the redirect link in the front-end application, the methods provided by the SSD can be used to parse the returned OAuth return value. Depending on the type of OAuth return value, different methods may be required for parsing. After parsing the return value, it can be stored in the front-end application's local storage or sent to the back-end for further processing.

[0073] Step S120: Determine the user login status corresponding to the user session based on the return value;

[0074] Step S130: Update the transit page according to the user's login status.

[0075] In this embodiment, the current user's global session is determined to be either logged in or offline based on the different return values. If the global session is logged in, the user session can be directly reactivated; if the global session is offline, the user needs to log in again and repeat the steps of accessing the subsystem.

[0076] As an optional implementation, when the status value in the return value is 0, it indicates that the user is logged in, and the access authorization code is updated on the transit page. When the status value in the return value is 1, it indicates that the user is offline, and the user is redirected to the login page.

[0077] For example, when the transit page loads, the OAuth return value can be retrieved via JavaScript, and its content can be examined. If the status value is 0, it indicates the user is logged in. The access authorization code is then updated to an element on the transit page, such as a hidden form field or a JavaScript variable. After reactivating the user session based on the access authorization code, the replay page retrieves the request and allows normal access to the business system page. If the status value is 1, it indicates the user is offline. The user can be redirected to the login page via JavaScript. After the user logs in and activates their global session, they are redirected to the business system.

[0078] In this embodiment, the OAuth process is proxied using a JavaScript SDK (Software Development Kit), which determines the user's global session login status and then performs different operations based on that status. All of this is implemented on the front end, simplifying the workflow. The JavaScript SDK provides simplified interfaces and methods, making the OAuth process proxying simpler and more intuitive.

[0079] Example 3

[0080] In this application embodiment, a user management device is proposed.

[0081] Reference Figure 4 , Figure 4 This is a schematic diagram of the terminal structure of the hardware operating environment involved in one embodiment of this application.

[0082] like Figure 4 As shown, the control terminal may include: a processor 1001, such as a CPU, a network interface 1003, a memory 1004, and a communication bus 1002. The communication bus 1002 is used to enable communication between these components. The network interface 1003 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1004 may be high-speed RAM or stable non-volatile memory, such as a disk drive. Alternatively, the memory 1004 may be a storage device independent of the aforementioned processor 1001.

[0083] Those skilled in the art will understand that Figure 4 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0084] like Figure 4 As shown, the memory 1004, which serves as a computer storage medium, may include an operating system, a network communication module, and a user management program.

[0085] exist Figure 4 In the user management device hardware structure shown, the processor 1001 can call the user management program stored in the memory 1004 and perform the following operations:

[0086] Upon receiving a page retrieval request for a subsystem, determine whether the user session corresponding to the page retrieval request has expired;

[0087] If the user session expires, receive the relay page and obtain the access authorization code for the relay page;

[0088] The user session is reactivated based on the access authorization code.

[0089] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and also perform the following operations:

[0090] If the user session expires, retrieve the OAuth return value according to the OAuth process proxied by the JavaScript SDK;

[0091] The user login status corresponding to the user session is determined based on the return value.

[0092] Update the transit page based on the user's login status.

[0093] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and also perform the following operations:

[0094] When the status value in the return value is 0, it indicates that the user is logged in, and the access authorization code is updated to the transit page.

[0095] When the status value in the returned value is 1, it indicates that the user is offline and will be redirected to the login page.

[0096] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and also perform the following operations:

[0097] Intercept the initial link of the page acquisition request, modify the request header of the initial link, and obtain the access authorization code;

[0098] Based on the client identifier, the access authorization code, and the initial link, generate the link corresponding to the page retrieval request.

[0099] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and also perform the following operations:

[0100] Import the JavaScript software development kit and initialize the software development kit;

[0101] Upon receiving a user login request, the authentication and authorization methods of the software development kit are invoked;

[0102] After authentication and authorization are completed, the authentication and authorization results are received, a callback function is generated, and the authentication and authorization results are saved.

[0103] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and further perform the following operations:

[0104] Send the access authorization code to the backend server;

[0105] Receive the response result returned by the backend server, and activate the user session or prompt the user that the access failed based on the response result.

[0106] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and also perform the following operations:

[0107] Periodically send user session verification requests to the backend server;

[0108] Based on the received response information, determine whether the user session has expired.

[0109] Optionally, the processor 1001 may call the user management program stored in the memory 1004 and also perform the following operations:

[0110] Obtain the authentication information corresponding to the user session;

[0111] Obtain the page retrieval request and add the authentication information to the request header of the page retrieval request.

[0112] In addition, to achieve the above objectives, embodiments of the present invention also provide a terminal device, including a memory, a processor, and a user management program stored in the memory and executable on the processor. When the processor executes the user management program, it implements the user management method described above.

[0113] In addition, to achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium storing a user management program, which, when executed by a processor, implements the user management method as described above.

[0114] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0115] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0116] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0117] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0118] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0119] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0120] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of the invention. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A user management method, characterized in that, The user management method includes the following steps: When a request to retrieve a page for a subsystem is received, a user session authentication request is periodically sent to the backend server. Based on the received response information, determine whether the user session has expired; If a user session expires, the OAuth return value is obtained according to the OAuth process proxied by the JavaScript SDK. OAuth is an open standard for authorizing access to protected resources, allowing users to authorize third-party applications to access their resources on another service provider without sharing their usernames and passwords. The OAuth return value includes a status code and an access authorization code or webpage link associated with the status code. During the OAuth process, each request contains correct authentication information. Upon receiving a page retrieval request for a subsystem, the initial link of the page retrieval request is intercepted, and the request header of the initial link is modified to obtain the access authorization code. Then, based on the client identifier, the access authorization code, and the initial link, a link corresponding to the page retrieval request is generated. This link is a link with added request headers. The user login status corresponding to the user session is determined based on the return value. When the status code in the return value is 0, it indicates that the user is logged in. The access authorization code is updated in the element of the transit page, which includes status code 0 and access authorization code. When the status code in the received return value is 1, it indicates that the current global session is offline. The relay page includes status code 1 and login page address. Receive the relay page and obtain the access authorization code for the relay page; The user session is reactivated based on the access authorization code. Specifically, on the front-end page, the access authorization code is sent to the back-end server. Upon receiving the authorization code, the back-end server uses it to send a request to the OAuth service provider to obtain an access token and a refresh token. The OAuth service provider verifies the validity of the access authorization code and returns the access token and refresh token to the back-end server. The back-end server stores the access token on its server and returns a response to the front-end page. Upon receiving the response, the front-end page stores the access token in local storage or a cookie, enabling the front-end page to use the access authorization code to activate the user's partial session and store the access token on the front-end. After reactivating the user session based on the access authorization code, the replay page retrieves the request and allows normal access to the business system page.

2. The user management method as described in claim 1, characterized in that, After the step of determining the user login status corresponding to the user session based on the return value, the method further includes: When the status code in the return value is 0, it indicates that the user is logged in, and the access authorization code is updated to the transit page. When the status code in the returned value is 1, it indicates that the user is offline and will be redirected to the login page.

3. The user management method as described in claim 1, characterized in that, Before the step of periodically sending a user session verification request to the backend server upon receiving a page retrieval request for the subsystem, the following steps are included: Import the JavaScript software development kit and initialize the software development kit; Upon receiving a user login request, the authentication and authorization methods of the software development kit are invoked; After authentication and authorization are completed, the authentication and authorization results are received, a callback function is generated, and the authentication and authorization results are saved.

4. The user management method as described in claim 1, characterized in that, The step of reactivating the user session based on the access authorization code includes: Send the access authorization code to the backend server; Receive the response result returned by the backend server, and activate the user session or prompt the user that the access failed based on the response result.

5. The user management method as described in claim 1, characterized in that, After the step of reactivating the user session based on the access authorization code, the following steps are included: Obtain the authentication information corresponding to the user session; Obtain the page retrieval request and add the authentication information to the request header of the page retrieval request.

6. A terminal device, characterized in that, The method includes a memory, a processor, and a user management program stored in the memory and executable on the processor, wherein when the processor executes the user management program, it implements the method of any one of claims 1-5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a user management program, which, when executed by a processor, implements the method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Processing method and system for single sign-on

    CN102546570A