JWT插件


    • shenyu-admin 基础配置 —> 插件管理 —> ,设置为开启。如果用户不想使用此功能,请在 admin 后台停用此插件。

    • 插件编辑里面新增配置。

      • secretKey:使用 jwt 生成 token 的时候的私钥,必填项。

      • 例如:白名单路径如下,则 filterPath 设置为 /cloud/shenyu/user,/cloud/shenyu/role

        • http://127.0.0.1:8080/cloud/shenyu/user
        • http://127.0.0.1:8080/cloud/shenyu/role
    • 在网关的 pom.xml 文件中添加 jwt 的支持。
    • 需要在网关统一鉴权。