You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by xi...@apache.org on 2022/10/04 02:04:36 UTC

[shenyu-website] branch main updated: [DOC] add casdoor doc (#778)

This is an automated email from the ASF dual-hosted git repository.

xiaoyu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new b14d35bbd7 [DOC] add casdoor doc (#778)
b14d35bbd7 is described below

commit b14d35bbd7cce4a8de60a838282666e9a5d57108
Author: jakiuncle <88...@users.noreply.github.com>
AuthorDate: Tue Oct 4 10:04:31 2022 +0800

    [DOC] add casdoor doc (#778)
---
 docs/plugin-center/security/casdoor.md             |  69 ++++++++++++++++++++
 .../plugin-center/security/casdoor-plugin.md       |  72 +++++++++++++++++++++
 .../img/shenyu/plugin/casdoor/casdooor_token.png   | Bin 0 -> 60286 bytes
 .../img/shenyu/plugin/casdoor/casdoor_casdoor.png  | Bin 0 -> 52804 bytes
 static/img/shenyu/plugin/casdoor/casdoor_cert.png  | Bin 0 -> 104008 bytes
 static/img/shenyu/plugin/casdoor/casdoor_cert2.png | Bin 0 -> 120180 bytes
 .../img/shenyu/plugin/casdoor/casdoor_config.png   | Bin 0 -> 59564 bytes
 .../shenyu/plugin/casdoor/casdoor_configPlugin.png | Bin 0 -> 27882 bytes
 .../shenyu/plugin/casdoor/casdoor_faillogin.png    | Bin 0 -> 5896 bytes
 static/img/shenyu/plugin/casdoor/casdoor_login.png | Bin 0 -> 36499 bytes
 .../shenyu/plugin/casdoor/casdoor_successlogin.png | Bin 0 -> 8033 bytes
 11 files changed, 141 insertions(+)

diff --git a/docs/plugin-center/security/casdoor.md b/docs/plugin-center/security/casdoor.md
new file mode 100644
index 0000000000..5f05923da1
--- /dev/null
+++ b/docs/plugin-center/security/casdoor.md
@@ -0,0 +1,69 @@
+---
+title: Casdoor Plugin
+keywords: [Casdoor]
+description: Casdoor plugin
+---
+
+ShenYu has Casdoor plugin to use Casdoor
+
+## Step1. Deploy Casdoor
+
+Firstly, the Casdoor should be deployed.
+
+You can refer to the Casdoor official documentation
+
+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 own app with the following steps.
+
+## Step2. Configure Casdoor application
+
+### 1. Create or use an existing Casdoor application
+
+### 2. Add Your redirect url
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_config.png" width="80%" height="80%" />
+
+### 3. On the certificate editing page, you can see your `certificate`
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_cert.png" width="80%" height="80%" />
+
+## Step3. Use Casdoor plugin in Shenyu
+
+### 1. Config Casdoor plugin in Shenyu
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_configPlugin.png" width="80%" height="80%" />
+
+note: because the shenyu only have Single line input box so we need add \n in every line of cert.
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_cert2.png" width="80%" height="80%" />
+
+You can copy it and paste it on the certificate of shenyu casdoor config.
+
+**You don't need save it in Casdoor certificate editing page**,because it just for copying.
+
+### 2. Confing Shenyu Casdoor's plugin
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_casdoor.png" width="80%" height="80%" />
+   You can config what you need to use Casdoor config
+
+### 3. Get the service and use
+
+#### 3.1 Visit the Web directly like
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_faillogin.png" width="80%" height="80%" />
+
+#### 3.2 Use Casdoor login like this
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_login.png" width="80%" height="80%" />
+   <img src="/img/shenyu/plugin/casdoor/casdoor_successlogin.png" width="80%" height="80%" />
+
+#### 3.3 Carry token in Headers,you also can visit it
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_token.png" width="80%" height="80%" />
+
+#### 3.4 It also can save name,id and organization in Headers so that you can use them in next time
diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/security/casdoor-plugin.md b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/security/casdoor-plugin.md
new file mode 100644
index 0000000000..863f938ab9
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/security/casdoor-plugin.md
@@ -0,0 +1,72 @@
+---
+title: Casdoor
+keywords: ["Casdoor"]
+description: Casdoor插件
+---
+
+ShenYu 有Casdoor插件去使用Casdoor
+
+## 第一步.部署Casdoor
+
+首先,我们需要部署Casdoor.
+
+我们可以参考Casdoor官方文档去部署它.
+
+在成功部署之后,我们需要确保:
+
+* Casdoor服务成功在 **http://localhost:8000**上运行
+
+* 打开你喜爱的浏览器浏览 **http://localhost:7001**,你可以看到Casdoor的登陆页面
+
+* 输入`admin`和`123`去测试登录是否成功
+
+  登陆成功之后,我们就可以使用casdoor.
+
+## 第二步.设置Casdoor应用
+
+### 1.创建或应用一个存在的组织
+
+### 2.添加我们的回调url
+
+  <img src="/img/shenyu/plugin/casdoor/casdoor_config.png" width="80%" height="80%" />
+
+### 3.在证书的编辑页面,我们能看到我们的`Certificate`
+
+  <img src="/img/shenyu/plugin/casdoor/casdoor_config.png" width="80%" height="80%" />
+
+## 第三步.运用Casdoor插件在Shenyu
+
+### 1.设置Casdoor插件在Shenyu
+
+​	<img src="/img/shenyu/plugin/casdoor/casdoor_configPlugin.png" width="80%" height="80%" />
+
+注意:因为Shenyu只有单行输入框所以我们需要增加\n在每一行的证书.
+
+​	<img src="/img/shenyu/plugin/casdoor/casdoor_cert2.png" width="80%" height="80%" />
+
+我们可以在复制他们并将它们粘贴到Shenyu的Casdoor配置中的certificate这一项中
+
+**我们不需要保存我们加\n的内容在Casdoor的证书设置处**,因为这只是为了复制方便.
+
+#### 2.设置Shenyu Casdoor的插件配置
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_casdoor.png" width="80%" height="80%" />
+
+​我们可以设置你所拥有的casdoor配置在Shenyu配置中
+
+### 3.得到服务和运用
+
+#### 3.1 直接访问页面
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_faillogin.png" width="80%" height="80%" />
+
+#### 3.2 使用Casdoor登录
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_login.png" width="80%" height="80%" />
+   <img src="/img/shenyu/plugin/casdoor/casdoor_successlogin.png" width="80%" height="80%" />
+
+#### 3.3携带token在Headers,你可以访问该页面
+
+   <img src="/img/shenyu/plugin/casdoor/casdoor_token.png" width="80%" height="80%" />
+
+#### 3.4 我们可以保存name,id和organization在Headers以至于你可以运用他们在下一次
diff --git a/static/img/shenyu/plugin/casdoor/casdooor_token.png b/static/img/shenyu/plugin/casdoor/casdooor_token.png
new file mode 100644
index 0000000000..722e785f79
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdooor_token.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_casdoor.png b/static/img/shenyu/plugin/casdoor/casdoor_casdoor.png
new file mode 100644
index 0000000000..af5dba3df0
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_casdoor.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_cert.png b/static/img/shenyu/plugin/casdoor/casdoor_cert.png
new file mode 100644
index 0000000000..2db297804b
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_cert.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_cert2.png b/static/img/shenyu/plugin/casdoor/casdoor_cert2.png
new file mode 100644
index 0000000000..6b654a4896
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_cert2.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_config.png b/static/img/shenyu/plugin/casdoor/casdoor_config.png
new file mode 100644
index 0000000000..209363f8b1
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_config.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_configPlugin.png b/static/img/shenyu/plugin/casdoor/casdoor_configPlugin.png
new file mode 100644
index 0000000000..3094d3c1a3
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_configPlugin.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_faillogin.png b/static/img/shenyu/plugin/casdoor/casdoor_faillogin.png
new file mode 100644
index 0000000000..c54d969c66
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_faillogin.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_login.png b/static/img/shenyu/plugin/casdoor/casdoor_login.png
new file mode 100644
index 0000000000..542f30e5f3
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_login.png differ
diff --git a/static/img/shenyu/plugin/casdoor/casdoor_successlogin.png b/static/img/shenyu/plugin/casdoor/casdoor_successlogin.png
new file mode 100644
index 0000000000..d718951a12
Binary files /dev/null and b/static/img/shenyu/plugin/casdoor/casdoor_successlogin.png differ