反馈已提交

网络繁忙

HTTP Authentication

  • Last update:  2023-07-13
  • Overview

    Version

    FineBI Version
    Functional Change

    6.0

    /

    Application Scenarios

    You may want to customize authentication rather than use the built-in authentication of the platform. For example, you want to customize authentication when integrating a template into your system.

    Functions

    If HTTP authentication is enabled, the platform will encrypt the entered username and password and transmit them to the HTTP authentication server. The HTTP authentication server will return the authentication result to the platform after performing the custom authentication logic.

    iconNote: Super admin is not restricted to HTTP authentication and can still use the built-in authentication.

    Authentication Through Node

    Downloading the Authentication File

    1. Click to download: http-authentication.zip

    2. Unzip the downloaded package into a local directory such as E:\HTTP.

    In the file auth.js under the directory http-authentication\node, you can see the HTTP authentication.

    The authentication logic of this section: Only if the username and password are consistent with those of the HTTP authentication server, can you log into the platform.

    You can modify if (content.username === content.password) in the file auth.js to change the authentication logic as needed.

    Starting the Server

    Open the command prompt and enter the following commands to start the server:

    1. Install npm first. The installation process is omitted.

    2. Go to the directory http-authentication\node.

    iconNote: The command below will lead you to the directory E:\HTTP\http-authentication\node. You can go to the directory where the unzipped files are.

    e:
    cd E:\HTTP\http-authentication\node

    3. Install dependencies.

    npm install

    4. Generate public key and private key. The generated keys will be in the file key.txt.

    npm run key

    5. Start the server. The first two commands are only required during initialization for the first time. Next time when you start the server, you can start with npm start.

    npm start

    The authentication address is http://0.0.0.0:3000/.

    Getting Public Key

    After starting the server, open the file key.txt in the folder Node, and copy the public key.

    Enabling HTTP Authentication on Decision-making Platform

    Log into the decision-making platform as admin, choose System Management > User Management, click  to go to Global Setting, enable HTTP Authentication, enter authentication address and public key, and click Save.

    iconNote: Password is not required for HTTP Authentication. Therefore, password is not required when you add users manually or synchronize users.

    Demonstration

    Click Save, and the prompt will pop up: Login information has expired, so please log in again.

    Enter the username restored in User Management on the login interface. If the password and username are consistent with those of HTTP authentication server, you can log in successfully. Otherwise, you cannot log in.

    Authentication Through Java

    The two authentication methods in this section: Only if the username and password are consistent, can the user log into the decision-making platform.

    Method One: Execute Through Source Code Project

    Downloading the Authentication File

    Download and unzip the package: http-authentication-java.zip

    Executing the Project

    Open the file pom.xml with IDEA or Eclipse and execute WebServerMain.

    Copying Public Key

    After starting the sever, open the file key.txt in the folder target of the compiling directory, copy public key to the platform, and the server address is http://0.0.0.0:9090/.

    iconNote:  If the file key.txt is modified, execute KeyGeneratorMain, and copy the file key.txt in the folder target of the compiling directory to the platform.

    Demonstration

    Click Save, and the prompt will pop up: Login information has expired, so please log in again.

    Enter the username restored in User Management on the login interface. If the username and password are consistent, you can log in successfully. Otherwise, you cannot log in.

    Method Two: Execute Through Command Lines

    Downloading the File

    1. Click to download the JAR package: http-authentication-java.jar

    2. Unzip the downloaded JAR package to a folder with WinRAR.

    iconNote: The path of the unzipped files cannot contain any spaces.

    Executing the File

    Go to the location of the unzipped files by entering the command lines. Enter java WebServerMain to start the server.

    iconNote: Ensure that Java development environment has been deployed on the local.

    Copying Public Key

    1. After starting the server, open the file key.txt, and copy public key.

    2. Paste the copied public key to the platform, and the server address is http://0.0.0.0:9090/.

    Demonstration

    Click Save, and the prompt will pop up: Login information has expired, so please log in again.

    Enter the username restored in User Management on the login interface. If the username and password are consistent, you can log in successfully. Otherwise, you cannot log in.


    附件列表


    主题: System Management
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    feedback

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭