Home

Awesome

yapi-plugin-oauth2

第三方插件,基于Oauth2协议登录,在生成的配置文件中,添加如下配置即可:

"plugins": [
    {
      "name": "qsso",
      "options": {
        "type": "oauth2",
        "hostscheme": "http",
        "hostname" : "your.oauth2server",
        "loginPath": "/api/v4/user",
        "authPath" : "/oauth/authorize",
        "tokenPath" : "/oauth/token",
        "redirectUri" : "http://your.yapiserver/api/plugin/oauth2/callback",
        "appId" : "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "appSecret" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "emailKey" : "emailkey",
        "userKey" : "usernamekey",
        "emailPostfix" : "@yapi.com"
      }
    }
  ]

使用注意:

这里面的配置项含义如下: