我在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": "pablo.picasso@company.com",
"upn": "pablo.picasso@company.com",
"uti": "kajshdfkljahsdfkjahsdkjfahsd",
"ver": "1.0"
}实际上我在找用户名。我们可以使用快捷方式或电子邮件登录到Windows。因此,如果用户名是Picasso,用户可以使用用户名PaPi登录。我在找那个。
发布于 2020-03-19 14:39:35
考虑到,你已经知道如何获取令牌了。现在看下面的例子
如果您想使用employeeId或identities或officeLocation获取Microsoft Graph API。试着用以下方法:
Request:
https://graph.microsoft.com/v1.0/users?$select=employeeId ,identities ,officeLocation Response:
{
"@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"
}
]
}
}见下面的屏幕截图:

如果需要更多细节,请参考正式文件。
发布于 2020-03-19 17:16:05
我对所有字段的解决方案(不使用mailboxSettings,因为get错误403访问被拒绝)
https://graph.microsoft.com/v1.0/me?$select=aboutMe,accountEnabled,ageGroup,assignedLicenses,assignedPlans,birthday,businessPhones,city,companyName,consentProvidedForMinor,country,createdDateTime,creationType,deletedDateTime,department,displayName,employeeId,faxNumber,givenName,hireDate,id,identities,imAddresses,mailNickname,mobilePhone,mySite,officeLocation,onPremisesDistinguishedName,onPremisesDomainName,onPremisesExtensionAttributes,onPremisesImmutableId,onPremisesLastSyncDateTime,onPremisesProvisioningErrors,onPremisesSamAccountName,onPremisesSecurityIdentifier,onPremisesSyncEnabled,onPremisesUserPrincipalName,otherMails,passwordPolicies,passwordProfile,pastProjects,postalCode,preferredDataLocation,preferredLanguage,preferredName,provisionedPlans,proxyAddresses,refreshTokensValidFromDateTime,responsibilities,schools,showInAddressList,skills,signInSessionsValidFromDateTime,state,streetAddress,surname,usageLocation,userPrincipalName,userType,interests,isResourceAccount,jobTitle,lastPasswordChangeDateTime,legalAgeGroupClassification,licenseAssignmentStates,mailhttps://stackoverflow.com/questions/60758083
复制相似问题