0.1.0 • Published 3 years ago

yapi-plugin-asso v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

forked from yangyinchun/yapi-plugin-ms-oauth

Yapi第三方插件,Microsoft Azure Active Directory 基于oauth2协议登录,安装并且在配置文件中添加如下配置:

"plugins": [{
    "name": "asso",
    "options": {
      "type": "oauth2",
      "hostscheme": "https",
      "hostname": "login.partner.microsoftonline.cn",
      "authPath": "/8209af61-7dcc-42b8-8cdf-xxxxxxxxxxxx/oauth2/v2.0/authorize",
      "tokenPath": "/8209af61-7dcc-42b8-8cdf-xxxxxxxxxxxx/oauth2/v2.0/token",
      "redirectUri": "https://yapi.example.com/api/plugin/oauth2/callback",
      "appId": "d4b1f920-ecf9-4386-adbc-xxxxxxxxxxxx",
      "appSecret": "ffl3k8E~.s7VsXgXT-l3I5Xt_xxxxxxxxx"
    }
  }
]

需要修改的配置项

名称含义示例
hostname终结点域名Azure AD: login.microsoftonline.com
  Azure AD China: login.partner.microsoftonline.cn
authPathOAuth 2.0 授权终结点(v2)/Tenant ID/oauth2/v2.0/authorize
tokenPathOAuth 2.0 令牌终结点(v2)/Tenant ID/oauth2/v2.0/token
redirectUri重定向 URIhttps://yapi.example.com/api/plugin/oauth2/callback
appId应用程序(客户端) IDd4b1f920-ecf9-4386-adbc-xxxxxxxxxxxx
appSecret客户端密码ffl3k8E~.s7VsXgXT-l3I5Xt_xxxxxxxxx
0.1.0

3 years ago

0.0.1

3 years ago