Tag: passport azure ad

Microsoft Azure Active Directory Passport身份validation

贝娄的代码运行良好,但是当授权头来自php代码的空令牌(eg-'Authorization:bearer')时,node.js应用程序会崩溃。 我正在使用“passport-azure-ad”节点模块。 我与邮政人检查,它是validation令牌,但是当请求来自PHPcurl请求,应用程序崩溃。 其原因是,http头在“passport-azure-ad”节点模块中设置了两次。 我无法捕捉到这个错误。 router.get('/getUser', passport.authenticate('oauth-bearer', { session: false, tenantIdOrName: TENANT }), function (req, token, done) { // Send response }); 崩溃错误跟踪 – _http_outgoing.js:356抛出错误('发送后不能设置标题'); ^ 错误:发送后无法设置标题。 在\ node_modules \ passport \ lib \ middleware \ authenticate.js:156:13) PHP代码=> $headers = array ('Authorization: bearer ' . $Requestheader['id_token']); $ch = curl_init (); curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true […]

利用州/ customState和passport-azure-ad

我无法弄清楚customState的目的,如果/如何,我可以利用它来传递数据到返回的url。 具体而言,我希望在login后将用户路由回原来的位置。我想我可以将原始URL传递给参数customState并在返回URL POST customState其返回给我,但似乎是编码或可能换成不同的值。 这是我想要达到的: 匿名用户访问/page/protected需要authentication。 代码调用passport.authenticate ,然后redirect用户login。 用户/auth/oidc/return并返回到预先configuration的返回URL,例如: /auth/oidc/return 。 代码处理从表单提交数据中提取信息。 用户被引导回到/page/protected 。

护照 – azure色广告,令牌validation

这个问题与passport-azure-ad有关,是否parsing和validation令牌? 我试图掌握使用护照 – azure色广告模块。 我用OpenID Connect成功login我的用户,拿起access_token并直接使用我的REST API,通过app.get('myapi',passport.authenticate('oath-bearer', {failureRedirect: '/'}), function(req,res){}); 但是,如果我尝试从由OpenID连接创build的会话注销,令牌仍然有效,直到它过期(通常3600秒)。 我正在使用access_token来保护我的端点不在Microsoft的API网关后面,所以我想撤销access_token并不是直截了当的。 有没有什么办法可以检查access_token是否使用passport-azure-ad被吊销? 最佳做法是什么?

ADauthentication组更改不反映

我正在使用OIDCStrategy的node js passport-azure-ad。 当我从一个组中删除一个用户,它不是在我的代码上的refrate req.user._json.groups[0] 返回包括已删除组的所有组。 但是当我尝试并重新启动我的节点js服务器组删除。 我如何强制更新组,而无需重新启动节点js服务器? 这是由于令牌caching吗? 我如何刷新passport-azure-ad中的令牌。 我试图search如何刷新passport azure-ad令牌,但没有发现与此相关。

使用passport-azure-ad OIDCStrategy与Passportjs时遇到问题

我正在尝试使用passport-azure-ad来validation用户身份。 该应用程序显示常见的login屏幕,但当我login,浏览器窗口变为空白,并显示一个微调指示其工作。 与此同时,我的服务器正在接收连续的POST请求到我的callbackterminal。 在此期间,我的护照function(validation,serializeUser和deserializeUser)都不会被调用。 这里是我的战略定义: passport.use("azure", new azureStrategy({ identityMetadata: 'https://login.microsoftonline.com/common/.well-known/openid-configuration', clientID: "*************************", responseType: 'code id_token', issuer: "https://sts.windows.net/********************/", responseMode: 'form_post', redirectUrl: "http://localhost:5055/auth/azure/callback", allowHttpForRedirectUrl: true, clientSecret: "**********************************" }, function(iss, sub, profile, accessToken, refreshToken, done) { console.log("ID TOken: ", profile.oid); //Never gets called console.log("User" ,profile) //Never gets called done(null, profile); })); passport.serializeUser(function(user, done){ console.log("serialize: ", user) //Never gets […]