login-sim/README.md

33 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Login Sim
IDMesh 调试用的组件,主要用于登录完成后拿到响应的用户信息,并重定向至开发者配置的指定地址。
## 开始
### 如何工作
Login sim 实际上模拟了一个受到 IDMesh SSO 保护的组件,它会在真实环境中完成用户登录流程(因此您可能需要创建测试用户以方便测试),
拿到用户凭据后它会根据配置信息,重定向至开发者配置的地址。
在过程中,它按照组件开发约定,将 `IDMesh-User-Id`、`IDMesh-User-Token` 写入 Cookie 并进行重定向。
### 安装
配置样例:
```json
{
"default_redirect_url": "https://default.cn",
"rules": {
"123": "https://somewhere123.cn"
}
}
```
配置说明:
`default_redirect_url`:必填,默认跳转地址,当未命中`roles`的规则时候会选择该地址进行重定向。
`rules`选填key 为用户 id 的字段串形式, value 为命中后需要重定向的地址。
注:除非在环境变量`CONFIG_FILE_PATH`中指定,系统将会从``/data/config/settings.json``中读取配置信息。