|
| 1 | +<!-- |
| 2 | +
|
| 3 | + Licensed to the Apache Software Foundation (ASF) under one |
| 4 | + or more contributor license agreements. See the NOTICE file |
| 5 | + distributed with this work for additional information |
| 6 | + regarding copyright ownership. The ASF licenses this file |
| 7 | + to you under the Apache License, Version 2.0 (the |
| 8 | + "License"); you may not use this file except in compliance |
| 9 | + with the License. You may obtain a copy of the License at |
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + Unless required by applicable law or agreed to in writing, |
| 12 | + software distributed under the License is distributed on an |
| 13 | + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | + KIND, either express or implied. See the License for the |
| 15 | + specific language governing permissions and limitations |
| 16 | + under the License. |
| 17 | +
|
| 18 | +--> |
| 19 | + |
| 20 | +[](https://www.apache.org/licenses/LICENSE-2.0.html) |
| 21 | + |
| 22 | + |
| 23 | +# Casdoor |
| 24 | + |
| 25 | +Casdoor can simply connect to [Apache IoTDB](https://github.com/apache/iotdb). |
| 26 | + |
| 27 | +Because the code for connecting casdoor has been added in [Apache IoTDB Web Workbench](https://github.com/apache/iotdb-web-workbench), we just need to configure application.yml in back-end and open front switch. |
| 28 | + |
| 29 | +## Step1. Deploy Casdoor |
| 30 | + |
| 31 | +Firstly, the Casdoor should be deployed. |
| 32 | + |
| 33 | +You can refer to the Casdoor official documentation for the [Server Installation](/docs/basic/server-installation). |
| 34 | + |
| 35 | +After a successful deployment, you need to ensure: |
| 36 | + |
| 37 | +- The Casdoor server is successfully running on **http://localhost:8000**. |
| 38 | +- Open your favorite browser and visit **http://localhost:7001**, you will see the login page of Casdoor. |
| 39 | +- Input `admin` and `123` to test login functionality is working fine. |
| 40 | + |
| 41 | +Then you can quickly implement a Casdoor-based login page in your own app with the following steps. |
| 42 | + |
| 43 | +## Step2. Configure Casdoor |
| 44 | + |
| 45 | +Configure casdoor can refer to [casdoor](https://door.casdoor.com/login)(Configure casdoor's browser better not use one browser as your develop browser). |
| 46 | + |
| 47 | +You also should configure an organization and an application. You also can refer to [casdoor](https://door.casdoor.com/login). |
| 48 | + |
| 49 | +### 2.1 you should create an organization |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +### 2.2 you should create an application |
| 54 | + |
| 55 | + |
| 56 | + |
| 57 | +## Step3. Open Apache IoTDB Web Workbench front-end switch |
| 58 | + |
| 59 | +Open this switch to make code and state send to back-end. |
| 60 | + |
| 61 | +This switch in the iotdb-web-workbench/fronted/.env |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +## Step4. Configure back-end code |
| 66 | + |
| 67 | +You should configure casdoor's Configuration in the iotdb-web-workbench/backend/src/main/resources/application.properties |
| 68 | + |
| 69 | +```ini |
| 70 | +casdoor.endpoint = http://localhost:8000 |
| 71 | +casdoor.clientId = <client id in previous step> |
| 72 | +casdoor.clientSecret = <client Secret in previous step> |
| 73 | +casdoor.certificate=<client certificate in previous step> |
| 74 | +casdoor.organizationName=IoTDB |
| 75 | +casdoor.applicationName=app-IoTDB |
| 76 | +``` |
| 77 | + |
| 78 | +## Result |
| 79 | + |
| 80 | + |
0 commit comments