A method for non-intrusive access of discuz forum to user center

By using the Discuz-Java service as middleware and leveraging Nginx and Lanxin proxy services to generate and verify login tokens, the problem of non-intrusive access to the user center from the Discuz forum was solved, achieving a stable and low-barrier technical solution.

CN116112248BActive Publication Date: 2025-01-07CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310082119.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-08
Publication Date
2025-01-07
Estimated Expiration
2043-02-08

AI Technical Summary

Technical Problem

Existing technologies require modifying the Discuz forum's PHP code to integrate with the user center, which is risky and technically challenging, making non-intrusive integration difficult.

Method used

By using the Discuz-Java service as middleware, and leveraging nginx and Lanxin proxy services to forward user requests to the user center, login tokens are generated and verified, avoiding direct modification of the Discuz forum code and achieving non-intrusive access.

Benefits of technology

This achieved stable integration between the Discuz forum and the user center, lowering the technical barrier, improving work efficiency, and ensuring the service stability of the Discuz forum.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112248B_ABST
    Figure CN116112248B_ABST
Patent Text Reader

Abstract

This invention relates to the field of network authentication technology, and provides a method for non-intrusive access to a user center from a Discuz forum. The method includes: periodically writing forum user data to a Discuz-Java service; forwarding user forum HTTP requests to the Discuz-Java service via a request proxy service; forwarding the forum HTTP requests to the user center via the Discuz-Java service, generating a login token, and returning the generated login token to the Discuz-Java service; sending a forum HTTP request carrying the login token to the user center, where the user center verifies the status of the login token and executes the forum HTTP request based on the verification result. This method for non-intrusive access to a user center from a Discuz forum, according to an exemplary embodiment of the present invention, can ensure the stability of the originally open-source Discuz forum service, lower the technical threshold, and improve work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of network authentication, and in particular to a method for non-invasively accessing a discuz forum to a user center. Background Art

[0002] Discuz is a universal community forum software system based on PHP+MySQL. Users can set up and install it simply without any programming skills, and build a forum service with complete functions, strong load capacity and high customization on the Internet.

[0003] In actual use, users may not want to log in with a username and password, but instead need to access the company's user center, Lanxin, or other existing authentication systems. Therefore, the PHP code of discuz itself needs to be modified, which requires developers to be very proficient in PHP and familiar with the business logic of discuz itself, which may pose risks to the operation of discuz itself.

[0004] As a developer of Java technology stack, I urgently need a method that does not invade the discuz forum itself. Based on the springboot system middleware, I can connect the ucenter of discuz and the authentication systems such as user center and blue letter that need to be opened, so that registration, login and logout in the user center can be synchronized to discuz. Summary of the invention

[0005] In view of this, in order to overcome the deficiencies of the prior art, the present invention aims to provide a method for non-intrusively accessing the discuz forum to a user center.

[0006] In one aspect, the present invention provides a method for non-intrusively accessing a discuz forum to a user center, comprising:

[0007] Step S1: Write forum user data to the discuz-java service at regular intervals;

[0008] Step S2: forward the user's forum http request to the discuz-java service through the request proxy service;

[0009] Step S3: forward the forum http request to the user center through the discuz-java service, generate a login token, and return the generated login token to the discuz-java service;

[0010] Step S4: Send the forum http request carrying the login token to the user center, the user center verifies the status of the login token, and executes the forum http request according to the verification result.

[0011] Furthermore, the present invention provides a method for non-invasively accessing the discuz forum to the user center, wherein step S2 comprises: when the client is a PC, forwarding the user's forum http request to the discuz-java service through the nginx reverse proxy service.

[0012] Furthermore, the present invention provides a method for non-invasively accessing the discuz forum to the user center, wherein step S2 comprises: when the client is a mobile terminal, forwarding the user's forum http request to the discuz-java service through the Lanxin proxy service.

[0013] Furthermore, the present invention provides a method for non-invasively accessing the discuz forum to the user center, step S3 includes: when the client is a PC, forwarding the forum http request to the user center login page through the discuz-java service, when the user's client has a successful login record, obtaining the user's login token through the browser, storing the obtained login token in the redis cache login token set, and returning the obtained login token to the discuz-java service.

[0014] Furthermore, the present invention provides a method for non-invasively accessing the discuz forum to the user center, step S3 includes: when the client is a mobile terminal, the user login information stored in the blue letter proxy service is forwarded to the discuz-java service through the forum http request, the discuz-java service forwards the user login information to the user center, the user center generates a login token according to the user login information, stores the generated login token in the redis cache login token set, and returns the generated login token to the discuz-java service.

[0015] Furthermore, the present invention provides a method for non-intrusive access of the Discuz forum to the user center. In step S4, the user center performs a status check on the login token, including:

[0016] The user center searches for the same login token in the login token set stored in the redis cache. If the same login token exists in the login token set stored in the redis cache, the login token is determined to be valid.

[0017] When the same login token does not exist in the login token set stored in the redis cache, it is determined that the login token is invalid.

[0018] Furthermore, the present invention provides a method for non-intrusive access of the Discuz forum to the user center. In step S4, the login is performed according to the verification result, including:

[0019] When the verification result of the login token is valid, query the user login information corresponding to the login token, return the obtained user login information to the discuz-java service, and execute the forum http request;

[0020] When the verification result of the login token is invalid, the verification result of the invalid login token is returned to the discuz-java service, and the forum login is logged out.

[0021] In another aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the above method is performed.

[0022] Finally, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the method are implemented when the processor executes the program.

[0023] The method of the present invention for non-intrusive access of the Discuz forum to the user center has the following beneficial effects:

[0024] 1. By implementing separate access to any request in the front-end discuz-java, the discuz forum and discuz-java service can be isolated from each other and do not interfere with each other, ensuring the stability of the original open source discuz forum service.

[0025] 2. Through ordinary Java development, it is possible to avoid the need to modify the underlying PHP code of the discuz forum, lower the technical work threshold and improve work efficiency.

[0026] 3. The discuz-java system is lightweight, easy to use, and easy to deploy, and has strong scalability. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. 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 paying creative work.

[0028] Figure 1 The present invention is a flowchart of a method for non-intrusively connecting a Discuz forum to a user center according to the first exemplary embodiment of the present invention.

[0029] Figure 2 This is a flow chart of a method for non-intrusively connecting a Discuz forum to a user center according to an exemplary second embodiment of the present invention. DETAILED DESCRIPTION

[0030] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0031] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.

[0032] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0033] The terms used in the following embodiments are explained as follows:

[0034] discuz-java: a proxy authentication service system based on java.

[0035] Discuz Forum: a widely used open source general community forum software system.

[0036] Java: is a programming language designed specifically for the distributed environment of the Internet.

[0037] HTTP request: refers to the request message from the client to the server. It includes: the resource request method, resource identifier and protocol used in the first line of the message.

[0038] nginx: is a high-performance HTTP and reverse proxy web server.

[0039] redis: Remote Dictionary Service, is an open source log-type, Key-Value database written in ANSI C language, supporting the network, memory-based and persistent, and providing APIs in multiple languages.

[0040] PHP: "Hypertext Preprocessor" is a scripting language executed on the server side. It is particularly suitable for Web development and can be embedded in HTML.

[0041] MySQL: a relational database management system.

[0042] Figure 1 FIG. 1 is a flow chart of a method for non-intrusively accessing a discuz forum to a user center according to an exemplary first embodiment of the present invention. Figure 1 As shown, the method described in this embodiment includes:

[0043] Step S1: Write forum user data to the discuz-java service at regular intervals;

[0044] Step S2: forward the user's forum http request to the discuz-java service through the request proxy service;

[0045] Step S3: forward the forum http request to the user center through the discuz-java service, generate a login token, and return the generated login token to the discuz-java service;

[0046] Step S4: Send the forum http request carrying the login token to the user center, the user center verifies the status of the login token, and executes the forum http request according to the verification result.

[0047] Figure 2 A flowchart of a method for non-intrusively accessing a discuz forum to a user center according to an exemplary second embodiment of the present invention is shown in FIG. Figure 1 A preferred embodiment of the method is shown.

[0048] like Figure 2 As shown, step S2 of the method of this embodiment includes: when the client is a PC, forwarding the user's forum http request to the discuz-java service through the nginx reverse proxy service. When the client is a mobile terminal, forwarding the user's forum http request to the discuz-java service through the blue letter proxy service.

[0049] The third exemplary embodiment of the present invention provides a method for non-intrusive access of the Discuz forum to the user center. The method of this embodiment is Figure 1 and Figure 2 A preferred embodiment of the method is shown.

[0050] Step S3 of the method of this embodiment includes:

[0051] When the client is a PC, the forum http request is forwarded to the user center login page through the discuz-java service. When the user's client has a successful login record, the user's login token is obtained through the browser, the obtained login token is stored in the redis cache login token collection, and the obtained login token is returned to the discuz-java service.

[0052] When the client is a mobile terminal, the user login information stored in the Lanxin proxy service is forwarded to the discuz-java service through the forum HTTP request. The discuz-java service forwards the user login information to the user center. The user center generates a login token based on the user login information, stores the generated login token in the redis cache login token collection, and returns the generated login token to the discuz-java service.

[0053] The fourth exemplary embodiment of the present invention provides a method for non-intrusive access of the Discuz forum to the user center. The method of this embodiment is Figure 1 and Figure 2 A preferred embodiment of the method is shown.

[0054] In step S4 of the method of this embodiment, the user center performs status verification on the login token, including:

[0055] The user center searches for the same login token in the login token set stored in the redis cache. If the same login token exists in the login token set stored in the redis cache, the login token is determined to be valid.

[0056] When the same login token does not exist in the login token set stored in the redis cache, the login token is determined to be invalid. In step S4 of the method of this embodiment, the login is performed according to the verification result, including:

[0057] When the verification result of the login token is valid, query the user login information corresponding to the login token, return the obtained user login information to the discuz-java service, and execute the forum http request;

[0058] When the verification result of the login token is invalid, the verification result of the invalid login token is returned to the discuz-java service, and the forum login is logged out.

[0059] Secondly, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed, the method of the present invention for non-intrusively accessing the Discuz forum to a user center is performed.

[0060] Finally, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method of the present invention for non-invasively connecting the Discuz forum to a user center are implemented.

[0061] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for non-intrusive access of a discuz forum to a user center, characterized in that: The method comprises: Step S1: Write forum user data to the discuz-java service at regular intervals; Step S2: forward the user's forum http request to the discuz-java service through the request proxy service; Step S3: forward the forum http request to the user center through the discuz-java service, generate a login token, and return the generated login token to the discuz-java service; Step S4: Send the forum http request carrying the login token to the user center, the user center verifies the status of the login token, and executes the forum http request according to the verification result.

2. The method for non-intrusive access of the discuz forum to the user center according to claim 1, characterized in that: Step S2 includes: when the client is a PC, forwarding the user's forum http request to the discuz-java service through the nginx reverse proxy service.

3. The method for non-intrusive access of the discuz forum to the user center according to claim 1, characterized in that: Step S2 includes: when the client is a mobile terminal, forwarding the user's forum http request to the discuz-java service through the Lanxin proxy service.

4. The method for non-intrusive access of the discuz forum to the user center according to claim 1, characterized in that: Step S3 includes: when the client is a PC, forwarding the forum http request to the user center login page through the discuz-java service, when the user's client has a successful login record, obtaining the user's login token through the browser, storing the obtained login token in the redis cache login token collection, and returning the obtained login token to the discuz-java service.

5. The method for non-intrusive access of the discuz forum to the user center according to claim 1, characterized in that: Step S3 includes: when the client is a mobile terminal, the user login information stored in the Lanxin proxy service is forwarded to the discuz-java service through the forum http request, the discuz-java service forwards the user login information to the user center, the user center generates a login token based on the user login information, stores the generated login token in the redis cache login token collection, and returns the generated login token to the discuz-java service.

6. The method for non-intrusive access of the discuz forum to the user center according to claim 1, characterized in that: In step S4, the user center performs status verification on the login token, including: The user center searches for the same login token in the login token set stored in the redis cache. If the same login token exists in the login token set stored in the redis cache, the login token is determined to be valid. When the same login token does not exist in the login token set stored in the redis cache, it is determined that the login token is invalid.

7. The method for non-intrusive access of the discuz forum to the user center according to claim 1, characterized in that: In step S4, the login is performed according to the verification result, including: When the verification result of the login token is valid, query the user login information corresponding to the login token, return the obtained user login information to the discuz-java service, and execute the forum http request; When the verification result of the login token is invalid, the verification result of the invalid login token is returned to the discuz-java service, and the forum login is logged out.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 7 is performed.

9. A computer device, characterized in that: The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.

Citation Information

Patent Citations

  • Forum access method based on mobile communication equipment terminal

    CN101808110A

  • A method for sending web page content and a proxy server

    CN102299931A