使用ADAL4J通过Graph API管理Azure AD [英] Managing Azure AD through Graph API using ADAL4J

查看:195
本文介绍了使用ADAL4J通过Graph API管理Azure AD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在尝试创建一个简单的应用程序,该应用程序允许我列出和编辑Azure Active Directory上的用户帐户.

我跟踪了一些示例,经过几个小时的研究,我提出了一段简单的代码,尝试从Azure AD获取令牌,并使用该令牌尝试查询Graph API以获取用户列表.

我看过的样本是:

https://github.com/AzureAD/azure-activedirectory-library-for-java

https://github.com/Azure-Samples/active-directory-java-native-headless

还有图书馆WIKI

https://github.com/AzureAD/azure-activedirectory-library-for-java/wiki

但是由于某种原因,我从azure中获得了401未经身份验证的状态代码,并显示以下错误消息:


I'm trying to create a simple app that allows me to list and edit user accounts on Azure Active Directory.

I followed some samples and after a few hours of research i've come up with a simple piece of code that attempts to obtain a token from Azure AD and with that token tries to query the Graph API to obtain a list of users.

The samples that i've take a look were:

https://github.com/AzureAD/azure-activedirectory-library-for-java

https://github.com/Azure-Samples/active-directory-java-native-headless

And the Library WIKI

https://github.com/AzureAD/azure-activedirectory-library-for-java/wiki

But for some reason i get an 401 Unauthenticated Status code from azure, with the following error message:

推荐答案

您正在使用Azure AD Graph API还是Microsoft Graph API?

Are you using Azure AD Graph API or Microsoft Graph API?

从Azure AD获取令牌后,如何在身份验证标头中进行调用以获取所需的输出?您可以共享代码段吗?

After getting token from Azure AD, how are you making a call in the authentication header to get the desired output? Could you share the code snippet?


这篇关于使用ADAL4J通过Graph API管理Azure AD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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