azure - 用户信息 - 获取更多

标签 azure oauth oauth-2.0 azure-active-directory microsoft-graph-api

我已在 Azure 中注册了应用程序。我https://graph.microsoft.com/v1.0/users来获取用户信息。

是否有任何选项可以获取有关用户的所有信息?看看我可以在 JSON 响应中获取哪些数据?

现在当我使用https://graph.microsoft.com/v1.0/users时我只得到几个信息,例如:

{
    "aio": "kjaldjsfhkjsadhflkdhsafkjadhsfa",
    "amr": "[\"pwd\"]",
    "family_name": "Picasso",
    "given_name": "Pablo",
    "ipaddr": "11.12.113.144",
    "name": "Pablo Picasso",
    "oid": "234234-2343-4343-43434-2342342",
    "onprem_sid": "234234234-23-423-4-234-2-34-234",
    "sub": "234233q45rtferfwverfwgw45grfg45g45",
    "tid": "sdfkjgasdhjfgasjdhfgashjdfgasdhjf",
    "unique_name": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0b7b6a696764257b62686a7878644b6864667b6a657225686466" rel="noreferrer noopener nofollow">[email protected]</a>",
    "upn": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f18190939d9edf8198929082829eb1929e9c81909f88df929e9c" rel="noreferrer noopener nofollow">[email protected]</a>",
    "uti": "kajshdfkljahsdfkjahsdkjfahsd",
    "ver": "1.0"
}

实际上我正在寻找用户名。我们可以使用快捷方式或电子邮件登录Windows。因此,如果用户名为 Pablo Picasso,则用户可以使用用户名 PaPi 登录。我正在寻找这个。

最佳答案

Considering, you already know how to get token. Now see below example

如果您想使用 Microsoft Graph API 获取 employeeIdidentitiesofficeLocation。 尝试以下方法:

请求:

https://graph.microsoft.com/v1.0/users?$select=employeeId ,identities ,officeLocation 

响应:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(employeeId,identities,officeLocation)",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/users?$select=employeeId+%2cidentities+%2cofficeLocation&$skiptoken=X%27445370740",
    "value": [
        {
            "employeeId": 0200010000001C3A54696E614068616E,
            "officeLocation": Redmond, Usa,
            "identities": [
                {
                    "signInType": "userPrincipalName",
                    "issuer": "someEmail.onmicrosoft.com",
                    "issuerAssignedId": "tenant.onmicrosoft.com"
                }
            ]
        }
}

请参阅下面的屏幕截图:

enter image description here

请引用Official document如果您需要更多详细信息。

关于azure - 用户信息 - 获取更多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60758083/

相关文章:

oauth - 如何使用访问 token 上传到 YouTube v3?

java - 如何使用 Spring Boot/Spring Security 包装对 OAuth2 不记名 token 请求的调用?

azure - 如何在 Azure 上重置 Kudu 缓存部署

azure - 在Azure逻辑应用程序的结果 View 中获取 "Failed to Fetch"

Azure部署: Could not load file or assembly 'dnx.clr.managed' or one of its dependencies.系统找不到指定的文件

php - OAuth 在一台主机上失败

Azure Web 应用程序的多个实例的 Azure Redis 超时

oauth - 了解 client_id 和 client_secret

ios - 在释放 <SFAuthenticationViewController> 时尝试加载 View Controller 的 View

azure - 用户信息 - 别名字段或获取额外 - 图 1.0