简体   繁体   English

如何在Azure AD中使用passport.js和OpenID Connect策略

[英]How to use passport.js and OpenID Connect strategy with Azure AD

I looking to authenticate users using OpenID Connect, Node.js, Passport.js against Azure AD. 我希望使用OpenID Connect,Node.js,Passport.js对Azure AD进行身份验证。 Could you please point me to any resources/docs and/or sample code? 能否请您指出任何资源/文档和/或示例代码?

I came across passport-openidconnect . 我遇到了护照 - openidconnect Is this still the active module? 这还是活动模块吗? are you aware of any other module that I could use for this? 你知道我可以使用的任何其他模块吗? If so if you could point me to some sample code that would be great! 如果是这样,如果你能指出一些很棒的示例代码!

There is a passport module specifically for Azure AD called passport-azure-ad Azure AD专用的护照模块名为passport-azure-ad

The steps to do set this up are: 设置此步骤的步骤如下:

  1. Register your application (in Azure AD) 注册您的应用程序(在Azure AD中)
  2. Install all the required npm packages. 安装所有必需的npm包。
  3. Setup your app to use the passport-azure-ad. 设置您的应用以使用passport-azure-ad。

    3.a Setup the passport strategy 3.a设置护照策略

    3.b Add methods to keep track of logged in users 3.b添加跟踪登录用户的方法

    3.c Initialize passport while loading the express engine 3.c在加载快车时初始化护照

    3.d Add the routes that will handle login/logoff 3.d添加将处理登录/注销的路由

  4. Use passport to issue sign-in and sign-out requests to Azure AD 使用护照向Azure AD发出登录和注销请求

Check out the official docs (which include a sample) for code for each of these steps: https://azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-openidconnect-nodejs/ 查看官方文档(包括示例)以获取每个步骤的代码: https//azure.microsoft.com/en-us/documentation/articles/active-directory-devquickstarts-openidconnect-nodejs/

The answer to your question is positive. 你的问题的答案是积极的。 There are several node.js modules you can use to implement authentication via AAD. 您可以使用几个node.js模块通过AAD实现身份验证。

Any further concern, please feel free to let me know. 如有任何疑问,请随时告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用没有状态/会话的passport.js(Google OpenID connect) - Using passport.js (Google OpenID connect) without state/session passport-azure-ad:使用哪种策略 - passport-azure-ad: which strategy to use 使用 Passport.js 的访问令牌的 Azure AD 无效签名 - Azure AD Invalid Signature of Access Token using Passport.js Passport.js Azure AD 身份验证总是第二次失败 - Passport.js Azure AD auth always fails the second time 使用Passport.js作为Facebook战略的企业防火墙背后 - Use Passport.js Behind Corporate Firewall for Facebook Strategy 如何在 Google api 中使用 Passport.js Google OAuth2 策略? - How to use Passport.js Google OAuth2 strategy with Google api? 如何使用 passport.js github 策略获取用户的电子邮件而不是 null - How to use passport.js github strategy to get emails of users instead of null 通过Passport.js Facebook策略进行身份验证后,如何使用Facebook Graph API? - How to use Facebook Graph API after authenticating with Passport.js facebook strategy? 如何在不创建架构或数据库模型的情况下使用passport.js 本地策略 - how to use passport.js local strategy without creating a schema,or database model 如何将req参数绑定或传递到Passport.js JWT策略? - How to bind or pass req parameter to Passport.js JWT Strategy?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM