From 3a38b80375112bb3d73309c8527314f7109d6719 Mon Sep 17 00:00:00 2001 From: jakiuncle <88994283+jakiuncle@users.noreply.github.com> Date: Wed, 28 Dec 2022 10:11:53 +0800 Subject: [PATCH] [improve][doc] Add casdoor document for administration-pulsar-manager (#499) * [improve][doc] Add casdoor document for administration-pulsar-manager * [improve][doc] Add casdoor document for administration-pulsar-manager * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * Update README.md Co-authored-by: Zixuan Liu * [improve][doc] Add casdoor document for administration-pulsar-manager * Update README.md * Update README.md Co-authored-by: Zixuan Liu --- README.md | 70 +++++++++++++++++++- docs/img/Pulsar-manager_editApplication.svg | 4 ++ docs/img/Pulsar-manager_editOrganization.svg | 4 ++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 docs/img/Pulsar-manager_editApplication.svg create mode 100644 docs/img/Pulsar-manager_editOrganization.svg diff --git a/README.md b/README.md index 89b5e378..d696244c 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ bkvm address => http://localhost:7750/bkvm ``` 2. Build and start the backend. - + ``` cd pulsar-manager ./gradlew build -x test @@ -273,6 +273,74 @@ The pulsar-manager can monitor topics and subscriptions. ![pulsar-manager-token](docs/img/pulsar-manager-token.gif) +## Casdoor + + +### Casdoor Installation + +You can use casdoor to realize sso. + +Casdoor can connect to Pulsar-manager simply. + +Because the code for connecting the casdoor has been added in Pulsar-manager, we need to configure the casdoor in the back-end and front-end. + +#### Step1. Deploy Casdoor + +Firstly, the Casdoor should be deployed. + +You can refer to the Casdoor official documentation for the [Casdoor](https://casdoor.org/docs/overview) + +After a successful deployment, you need to ensure: + +- The Casdoor server is successfully running on **http://localhost:8000**. +- Open your favorite browser and visit **http://localhost:7001**, you will see the login page of Casdoor. +- Input `admin` and `123` to test login functionality is working fine. + +Then you can quickly implement a casdoor based login page in your app with the following steps. + +#### step2. Configure Casdoor + +Configure casdoor can refer to [casdoor](https://door.casdoor.com/login)(Configure casdoor's browser better not use one browser with your develop browser). + +You also should configure the organization, and application, you also can refer to [casdoor](https://door.casdoor.com/login). + +##### step2.1 you should create an organization + +![organization](/docs/img/Pulsar-manager_editOrganization.svg) + +##### step2.2 you should create an application + +![application](/docs/img/Pulsar-manager_editApplication.svg) + +#### Step3. Configure back-end code + +You should configure casdoor's Configuration in the Line 154 of pulsar-manager/src/main/resources/application.properties + +```ini +casdoor.endpoint=http://localhost:8000 +casdoor.clientId= +casdoor.clientSecret= +casdoor.certificate= +casdoor.organizationName=pulsar +casdoor.applicationName=app-pulsar +``` + +#### Step4. Configure front-end code + +You also need configure casdoor's Configuration in the Line 50 of pulsar-manager/front-end/src/main.js + +``` +const config = { + serverUrl: "http://localhost:7001", + clientId: "6ba06c1e1a30929fdda7", + organizationName: "pulsar", + appName: "app-plusar", + redirectPath: "/#callback", +}; +``` + +Now you can use Casdoor. + ## Development ### Default Test database HerdDB diff --git a/docs/img/Pulsar-manager_editApplication.svg b/docs/img/Pulsar-manager_editApplication.svg new file mode 100644 index 00000000..372fd734 --- /dev/null +++ b/docs/img/Pulsar-manager_editApplication.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/docs/img/Pulsar-manager_editOrganization.svg b/docs/img/Pulsar-manager_editOrganization.svg new file mode 100644 index 00000000..21e41506 --- /dev/null +++ b/docs/img/Pulsar-manager_editOrganization.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file