OAuth2orize 是 NodeJS 的授权服务器工具包。它提供了一套中间件, 这些中间件与 passport 身份验证策略和特定于应用程序的路由处理程序相结合, 可用于组装实现 OAuth 2.0 协议的服务器。
server.exchange(oauth2orize.exchange.password({userProperty: 'clientPortal'}, (client, username, password, scope, body, done) => {
}));
验证请求API的body内容:
{
"grant_type": "password",
"username": "123@163.com",
"password": "123"
}
function password(options: Options, issue: (client: any, username: string, password: string, scope: string[], body: any, authInfo: any, issued: ExchangeDoneFunction) => void): MiddlewareFunction;