我希望指定一个连接auth0/express-openid-connect。我们目前没有一个用户登录屏幕的选项来查找域,所以我们指定了2个不同的登录路径1为我们的客户和1为我们的维护者。Passport-auth0允许这样做:
app.get(
'/login/google',
passport.authenticate('auth0', {connection: 'google-oauth2'}),
function (req, res) {
res.redirect('/');
}
);
但据我所知,新的Auth0库(express-openid-connect)不允许指定连接。有人知道这是怎么做的吗?
来自Auth0的一位支持工程师回答了我的问题。你可以把它放在authorizationparameters中。来自他们答案的代码:
const config = {
authRequired: false,
auth0Logout: true,
authorizationParams: {
// Note: you need to provide required parameters if this object is set.
response_type: "id_token",
response_mode: "form_post",
scope: "openid profile email",
// Additional parameters
connection: "google-oauth2"
}
};
感谢Auth0团队如此响应,即使它是一个新类型的问题!