我正在使用 Microsoft Graph API,在尝试通过 IssuerAssignedId 搜索用户时,如果要与之比较的字符串中存在冒号符号(“:”),我会得到一个奇怪的异常。
通过图形浏览器使用如下查询搜索用户:
https://graph.microsoft.com/v1.0/users?$select=identities&$filter=identities/any(id:id/issuer eq 'someTenantId' and id/issuerAssignedId eq 'someIssuerAssignedId')
在要与 IssuerAssignedId 进行比较的字符串中的任意位置添加冒号,如下所示:
https://graph.microsoft.com/v1.0/users?$select=identities&$filter=identities/any(id:id/issuer eq 'someTenantId' and id/issuerAssignedId eq 'someIssuerAssignedId:')
给我以下回复:
{
"error": {
"code": "Request_BadRequest",
"message": "Unsupported property or property value or combination of property and operation occured",
"innerError": {
"date": "xxxxxx",
"request-id": "xxxxxx",
"client-request-id": "xxxxxx"
}
}
}
这只发生在这个确切的字段中,
issuer
字段可以与冒号进行比较。
为了让事情变得更加复杂,在使用实际的 C# 代码访问 Graph API 时,要重现此行为,不仅需要在字符串中的任何位置放置一个冒号,还需要放置一个
@
符号。
这是我缺少的 Graph API 的某些功能,还是这个领域的特殊性,或者是一个错误?除了根本不通过冒号搜索之外,是否可以做一些事情?
根据文档,仅允许使用字母数字字符和符号
-
或_
。
如果您需要符号
:
来支持,那么最好的方法是创建反馈,我们可以投票。
https://feedbackportal.microsoft.com/feedback/forum/ebe2edae-97d1-ec11-a7b5-0022481f3c80