我有许多子域,需要为身份验证请求保留正确的子域。我的OAuth提供程序允许我在回调函数的响应中向授权添加一个自定义字段'state‘。
我需要将“state”参数设置为来自原始请求中的referrer头的子域。但是,我无法访问下面代码中的request对象。如何使状态参数的值基于请求头动态?
appSecure.get('/oauth/authorize', passport.authenticate('forcedotcom', { state: 'test' }));
发布于 2013-10-09 17:07:23
结束护照呼叫:
function dynamicStateAuth(req, res, next) {
passport.authenticate('forcedotcom', { state: req.foo })(req, res, next)
}
appSecure.get('/oauth/authorize', dynamicStateAuth);
https://stackoverflow.com/questions/19268323
复制相似问题