如何将用户添加到Azure与图形API的Active Directory [英] How to Add users to Azure Active Directory with Graph API

查看:143
本文介绍了如何将用户添加到Azure与图形API的Active Directory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解Active Directory的图形API如何Azure的工程将用户添加到目录中。根据这样的:

I am trying to understand how Azure Active Directory Graph API works for adding users to the directory. According to this:

http://msdn.microsoft.com/en-us/库/天蓝色/ dn130117.aspx

我需要存取权限的图形API URL和一些在授权头被称为承载令牌传递,这样就会让我补充的请求体指定的用户。不过,我不知道在那里我能得到其中的一个标记。我所有的研究指出,用户已经被验证已经获得令牌,哪一种跳动点,因为我想要添加的用户,以便他可以验证。

I need to acces the graph API URL and pass in something called a "bearer token" in the "Authorization" header so that it will allow me to add the user specified in the request's body. However, I have no idea where I can get one of these tokens. All my research points to the user having to be already authenticated to get a token, which kind of beats the point, since I want to add the user so he can authenticate.

我已经配置我在Azure管理门户的应用程序,并认为承载标记是客户端ID当我去我的目录添加的应用程序,我得到。但是,当我通过这个号码给图形API,我得到访问令牌缺少或有错误。我现在用的提琴手Web调试应用程序测试此。

I have configured my app in the Azure Management Portal, and thought the bearer token was the "Client ID" that I get when I go to my added applications in the Directory. But when I pass this number to the Graph API, I get "Access Token Missing or malformed". I am testing this using the Fiddler Web Debugger app.

推荐答案

2,这些职位描述得很透彻步骤获得所需的令牌两种不同情况:

These 2 posts describe very thoroughly the steps to get the required token in 2 different scenarios:

授权code格兰特流量:的http:// MSDN。 microsoft.com/en-us/library/azure/dn645542.aspx

Authorization Code Grant flow: http://msdn.microsoft.com/en-us/library/azure/dn645542.aspx

客户端凭证授予流量: http://msdn.microsoft.com /en-us/library/azure/dn645543.aspx

Client Credentials Grant flow: http://msdn.microsoft.com/en-us/library/azure/dn645543.aspx

如果您要使用的客户端ID和客户端密钥来验证您的客户端的Azure Active Directory中,那么你应该阅读文章2次。第一个是一个已经存在的用户进行认证。

If you want to use the Client Id and Client Key to authenticate your client to Azure Active Directory, then you should read the 2nd article. The first one is to authenticate an already existing user.

如果您希望以编程方式获得的OAuth2令牌,那么你可以使用AAD认证库:的 http://msdn.microsoft.com/en-us/library/azure/dn151135.aspx

If you want to programmatically get the OAuth2 token, then you could use the AAD authentication libraries: http://msdn.microsoft.com/en-us/library/azure/dn151135.aspx

这篇关于如何将用户添加到Azure与图形API的Active Directory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆