1.0.0 • Published 4 years ago
yapi-plugin-oidc-tmp v1.0.0
yapi-plugin-oidc
第三方插件,OIDC登录,在生成的配置文件中,添加如下配置即可:
"plugins": [
{
"name": "oidc",
"options": {
"authUrl": "auth url",
"tokenUrl": "token url",
"userUrl": "user urll",
"callbackUrl": "your_yapi_server_host/api/user/login_by_token",
"clientId": "your client id",
"clientSecret": "your client secret",
"scope": "your scope",
"emailKey" : "emailkey",
"userKey" : "usernamekey",
"emailPostfix" : "@yapi.com"
}
}
]
使用注意:
- Oauth2服务器用户信息需要提供:
email
和username
两个字段,如果字段名不一致,可以通过emailKey
和userKey
设置,如果没有电子邮箱字段,可以使用用户名字段+emailPostfix
属性设置默认电子邮箱地址(电子邮箱是Yapi用户唯一标志)
这里面的配置项含义如下:
authUrl
授权URLtokenUrl
获取access_token URLuserUrl
获取用户信息URLcallbackUrl
重定向回调URLclientId
clientId或者appIdclientSecret
clientSecret或者appSecretscope
授权范围emailKey
用户信息电子邮件字段keyuserKey
用户信息用户名字段keyemailPostfix
邮箱后缀
1.0.0
4 years ago