简体   繁体   English

如何从 node.js 脚本登录 azure 广告(无浏览器流程)

[英]How to sign in azure ad from node.js script(without browser flow)

I want to CALL api which needs azure ad authentication.我想打电话给需要 azure 广告身份验证的 api。
I succeeded azure ad authentication from browser sign in, but I also want to access to api from script.我通过浏览器登录成功了 azure 广告身份验证,但我也想从脚本访问 api。 How can I sign in azure without browser sign in flow?如何在没有浏览器登录流程的情况下登录 azure?

additional question.附加问题。

I succeeded server-to-server authentication flow, but Is there way to call api as an "azure ad account"?我成功实现了服务器到服务器的身份验证流程,但是有没有办法将 api 称为“天蓝色广告帐户”?

You can implement client credential flow in node.js which will not require browser.您可以在不需要浏览器的 node.js 中实现客户端凭证流。

  1. Please find document which can help you in adding Azure Active Directory modules for Node.js请找到可以帮助您为 Node.js 添加 Azure Active Directory 模块的文档
  2. Please find code sample here which illustrates server-to-server authentication via client credentials flow.在此处找到代码示例,该示例说明了通过客户端凭据流进行的服务器到服务器身份验证。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM