Node.js 膝关节炎护照密码发放策略
您好,我正在尝试使用Koa passport实施密码授予策略。我配置了一个策略,如下所示Node.js 膝关节炎护照密码发放策略,node.js,typescript,passport.js,passport-facebook,koa-passport,Node.js,Typescript,Passport.js,Passport Facebook,Koa Passport,您好,我正在尝试使用Koa passport实施密码授予策略。我配置了一个策略,如下所示 passport.use(new PasswordGrantStrategy({ tokenURL: "http://localhost:3001/api/v1/oauth/token", clientID: "democlient1", clientSecret: "democlientsecret1", sc
passport.use(new PasswordGrantStrategy({
tokenURL: "http://localhost:3001/api/v1/oauth/token",
clientID: "democlient1",
clientSecret: "democlientsecret1",
scope: "profile",
grant_type: "password",
customHeaders: {Authorization: "Basic ZGVtb2NsaWVudDE6ZGVtb2NsaWVudHNlY3JldDE=", scope: "profile" }
},
async (accessToken: string, refreshToken: string, profile: any,
done: (error: any, user?: any, options?: IVerifyOptions) => void) => {
console.log("Details ", accessToken, profile);
done(null, profile);
}));
这就是我尝试验证的方式
return passport.authenticate("password-grant", {
username: "test",
password: "test"
}, (err: any, user: any, info: any, status: any) => {
console.log("Inside Callback method");
})(ctx, next);
谁能帮帮我吗。上面的代码不调用令牌URL。但是该控件位于passport.authenticate中定义的回调方法的内部
提前谢谢