Identities - Read Identities
解析旧式标识信息,以便与旧版 API(例如安全 API)配合使用
GET https://vssps.dev.azure.com/{organization}/_apis/identities?api-version=7.1-preview.1
GET https://vssps.dev.azure.com/{organization}/_apis/identities?descriptors={descriptors}&identityIds={identityIds}&subjectDescriptors={subjectDescriptors}&searchFilter={searchFilter}&filterValue={filterValue}&queryMembership={queryMembership}&api-version=7.1-preview.1
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
organization
|
path |
string |
Azure DevOps 组织的名称。 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 这应设置为“7.1-preview.1”才能使用此版本的 API。 |
descriptors
|
query |
string |
要解析的标识描述符的逗号分隔列表 |
|
filter
|
query |
string |
searchFilter 指定的搜索值。 |
|
identity
|
query |
string |
要解析的存储密钥的逗号分隔列表 |
|
query
|
query |
要包含在标识中的成员身份信息。 对于无成员身份数据,值可以为 None,也可以是 Direct 以包含标识所属的组,以及作为此标识成员的标识 (组仅) |
||
search
|
query |
string |
要执行的搜索的类型。 值可以是 accountName (domain\alias) 、DisplayName、MailAddress、General (显示名称、帐户名或唯一名称) ,或 LocalGroupName (仅搜索 Azure Devops 组) 。 |
|
subject
|
query |
string |
要解析的主题描述符的逗号分隔列表 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
Identity[] |
成功的操作 |
安全性
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
名称 | 说明 |
---|---|
vso.identity | 授予读取标识和组的能力。 |
示例
By Email |
By Identity |
By Ids |
By Name |
By Subject Descriptors |
By Email
Sample Request
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?searchFilter=General&filterValue=jtseng@vscsi.us&queryMembership=None&api-version=7.1-preview.1
Sample Response
{
"count": 1,
"value": [
{
"id": "81fa6389-0872-6fdd-a451-7ba7880f566a",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;7a394543-62fd-4274-a7d2-8fac775942b6\\jtseng@vscsi.us",
"subjectDescriptor": "aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4",
"providerDisplayName": "Jia-hao Tseng",
"isActive": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "User"
},
"Description": {
"$type": "System.String",
"$value": ""
},
"Domain": {
"$type": "System.String",
"$value": "7a394543-62fd-4274-a7d2-8fac775942b6"
},
"Account": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"DN": {
"$type": "System.String",
"$value": ""
},
"Mail": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"SpecialType": {
"$type": "System.String",
"$value": "Generic"
},
"Alias": {
"$type": "System.String",
"$value": "jtseng"
},
"PUID": {
"$type": "System.String",
"$value": "aad:100FAFF21C1B5261"
},
"ComplianceValidated": {
"$type": "System.DateTime",
"$value": "2020-04-23T00:00:00Z"
},
"http://schemas.microsoft.com/identity/claims/objectidentifier": {
"$type": "System.String",
"$value": "55c8c7b6-7ace-43bc-918f-304dfa2b6317"
},
"MetadataUpdateDate": {
"$type": "System.DateTime",
"$value": "2018-07-10T16:11:40Z"
},
"DirectoryAlias": {
"$type": "System.String",
"$value": "jtseng"
}
},
"resourceVersion": 2,
"metaTypeId": 0
}
]
}
By IdentityDescriptors
Sample Request
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?descriptors=Microsoft.IdentityModel.Claims.ClaimsIdentity;7a394543-62fd-4274-a7d2-8fac775942b6\jtseng@vscsi.us,Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1725938060-2279921994-2555521242-2616350130-0-0-0-0-3&queryMembership=None&api-version=7.1-preview.1
Sample Response
{
"count": 2,
"value": [
{
"id": "81fa6389-0872-6fdd-a451-7ba7880f566a",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;7a394543-62fd-4274-a7d2-8fac775942b6\\jtseng@vscsi.us",
"subjectDescriptor": "aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4",
"providerDisplayName": "Jia-hao Tseng",
"isActive": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "User"
},
"Description": {
"$type": "System.String",
"$value": ""
},
"Domain": {
"$type": "System.String",
"$value": "7a394543-62fd-4274-a7d2-8fac775942b6"
},
"Account": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"DN": {
"$type": "System.String",
"$value": ""
},
"Mail": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"SpecialType": {
"$type": "System.String",
"$value": "Generic"
},
"Alias": {
"$type": "System.String",
"$value": "jtseng"
},
"PUID": {
"$type": "System.String",
"$value": "aad:100FAFF21C1B5261"
},
"ComplianceValidated": {
"$type": "System.DateTime",
"$value": "2020-04-23T00:00:00Z"
},
"http://schemas.microsoft.com/identity/claims/objectidentifier": {
"$type": "System.String",
"$value": "55c8c7b6-7ace-43bc-918f-304dfa2b6317"
},
"MetadataUpdateDate": {
"$type": "System.DateTime",
"$value": "2018-07-10T16:11:40Z"
},
"DirectoryAlias": {
"$type": "System.String",
"$value": "jtseng"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
{
"id": "7c86b535-818b-423f-b0fd-19a2e9f32710",
"descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1725938060-2279921994-2555521242-2616350130-0-0-0-0-3",
"subjectDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xNzI1OTM4MDYwLTIyNzk5MjE5OTQtMjU1NTUyMTI0Mi0yNjE2MzUwMTMwLTAtMC0wLTAtMw",
"providerDisplayName": "[jtseng]\\Project Collection Valid Users",
"isActive": true,
"isContainer": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "Group"
},
"Description": {
"$type": "System.String",
"$value": "This application group contains all users and groups that have access to the Team Project Collection."
},
"Domain": {
"$type": "System.String",
"$value": "vstfs:///Framework/IdentityDomain/8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"Account": {
"$type": "System.String",
"$value": "Project Collection Valid Users"
},
"SecurityGroup": {
"$type": "System.String",
"$value": "SecurityGroup"
},
"SpecialType": {
"$type": "System.String",
"$value": "EveryoneApplicationGroup"
},
"ScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"ScopeType": {
"$type": "System.String",
"$value": "ServiceHost"
},
"LocalScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"SecuringHostId": {
"$type": "System.Guid",
"$value": "e26baa74-481c-42bc-a78c-f2a89decc807"
},
"ScopeName": {
"$type": "System.String",
"$value": "jtseng"
},
"GlobalScope": {
"$type": "System.String",
"$value": "GlobalScope"
},
"VirtualPlugin": {
"$type": "System.String",
"$value": ""
}
},
"resourceVersion": 2,
"metaTypeId": 255
}
]
}
By Ids
Sample Request
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?identityIds=81fa638908726fdda4517ba7880f566a,7c86b535818b423fb0fd19a2e9f32710&queryMembership=None&api-version=7.1-preview.1
Sample Response
{
"count": 2,
"value": [
{
"id": "81fa6389-0872-6fdd-a451-7ba7880f566a",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;7a394543-62fd-4274-a7d2-8fac775942b6\\jtseng@vscsi.us",
"subjectDescriptor": "aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4",
"providerDisplayName": "Jia-hao Tseng",
"isActive": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "User"
},
"Description": {
"$type": "System.String",
"$value": ""
},
"Domain": {
"$type": "System.String",
"$value": "7a394543-62fd-4274-a7d2-8fac775942b6"
},
"Account": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"DN": {
"$type": "System.String",
"$value": ""
},
"Mail": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"SpecialType": {
"$type": "System.String",
"$value": "Generic"
},
"Alias": {
"$type": "System.String",
"$value": "jtseng"
},
"PUID": {
"$type": "System.String",
"$value": "aad:100FAFF21C1B5261"
},
"ComplianceValidated": {
"$type": "System.DateTime",
"$value": "2020-04-23T00:00:00Z"
},
"http://schemas.microsoft.com/identity/claims/objectidentifier": {
"$type": "System.String",
"$value": "55c8c7b6-7ace-43bc-918f-304dfa2b6317"
},
"MetadataUpdateDate": {
"$type": "System.DateTime",
"$value": "2018-07-10T16:11:40Z"
},
"DirectoryAlias": {
"$type": "System.String",
"$value": "jtseng"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
{
"id": "7c86b535-818b-423f-b0fd-19a2e9f32710",
"descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1725938060-2279921994-2555521242-2616350130-0-0-0-0-3",
"subjectDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xNzI1OTM4MDYwLTIyNzk5MjE5OTQtMjU1NTUyMTI0Mi0yNjE2MzUwMTMwLTAtMC0wLTAtMw",
"providerDisplayName": "[jtseng]\\Project Collection Valid Users",
"isActive": true,
"isContainer": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "Group"
},
"Description": {
"$type": "System.String",
"$value": "This application group contains all users and groups that have access to the Team Project Collection."
},
"Domain": {
"$type": "System.String",
"$value": "vstfs:///Framework/IdentityDomain/8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"Account": {
"$type": "System.String",
"$value": "Project Collection Valid Users"
},
"SecurityGroup": {
"$type": "System.String",
"$value": "SecurityGroup"
},
"SpecialType": {
"$type": "System.String",
"$value": "EveryoneApplicationGroup"
},
"ScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"ScopeType": {
"$type": "System.String",
"$value": "ServiceHost"
},
"LocalScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"SecuringHostId": {
"$type": "System.Guid",
"$value": "e26baa74-481c-42bc-a78c-f2a89decc807"
},
"ScopeName": {
"$type": "System.String",
"$value": "jtseng"
},
"GlobalScope": {
"$type": "System.String",
"$value": "GlobalScope"
},
"VirtualPlugin": {
"$type": "System.String",
"$value": ""
}
},
"resourceVersion": 2,
"metaTypeId": 255
}
]
}
By Name
Sample Request
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?searchFilter=General&filterValue=Project Collection Valid Users&queryMembership=None&api-version=7.1-preview.1
Sample Response
{
"count": 1,
"value": [
{
"id": "7c86b535-818b-423f-b0fd-19a2e9f32710",
"descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1725938060-2279921994-2555521242-2616350130-0-0-0-0-3",
"subjectDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xNzI1OTM4MDYwLTIyNzk5MjE5OTQtMjU1NTUyMTI0Mi0yNjE2MzUwMTMwLTAtMC0wLTAtMw",
"providerDisplayName": "[jtseng]\\Project Collection Valid Users",
"isActive": true,
"isContainer": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "Group"
},
"Description": {
"$type": "System.String",
"$value": "This application group contains all users and groups that have access to the Team Project Collection."
},
"Domain": {
"$type": "System.String",
"$value": "vstfs:///Framework/IdentityDomain/8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"Account": {
"$type": "System.String",
"$value": "Project Collection Valid Users"
},
"SecurityGroup": {
"$type": "System.String",
"$value": "SecurityGroup"
},
"SpecialType": {
"$type": "System.String",
"$value": "EveryoneApplicationGroup"
},
"ScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"ScopeType": {
"$type": "System.String",
"$value": "ServiceHost"
},
"LocalScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"SecuringHostId": {
"$type": "System.Guid",
"$value": "e26baa74-481c-42bc-a78c-f2a89decc807"
},
"ScopeName": {
"$type": "System.String",
"$value": "jtseng"
},
"GlobalScope": {
"$type": "System.String",
"$value": "GlobalScope"
},
"VirtualPlugin": {
"$type": "System.String",
"$value": ""
}
},
"resourceVersion": 2,
"metaTypeId": 255
}
]
}
By Subject Descriptors
Sample Request
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?subjectDescriptors=aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4,vssgp.Uy0xLTktMTU1MTM3NDI0NS0xNzI1OTM4MDYwLTIyNzk5MjE5OTQtMjU1NTUyMTI0Mi0yNjE2MzUwMTMwLTAtMC0wLTAtMw&queryMembership=None&api-version=7.1-preview.1
Sample Response
{
"count": 2,
"value": [
{
"id": "81fa6389-0872-6fdd-a451-7ba7880f566a",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;7a394543-62fd-4274-a7d2-8fac775942b6\\jtseng@vscsi.us",
"subjectDescriptor": "aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4",
"providerDisplayName": "Jia-hao Tseng",
"isActive": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "User"
},
"Description": {
"$type": "System.String",
"$value": ""
},
"Domain": {
"$type": "System.String",
"$value": "7a394543-62fd-4274-a7d2-8fac775942b6"
},
"Account": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"DN": {
"$type": "System.String",
"$value": ""
},
"Mail": {
"$type": "System.String",
"$value": "jtseng@vscsi.us"
},
"SpecialType": {
"$type": "System.String",
"$value": "Generic"
},
"Alias": {
"$type": "System.String",
"$value": "jtseng"
},
"PUID": {
"$type": "System.String",
"$value": "aad:100FAFF21C1B5261"
},
"ComplianceValidated": {
"$type": "System.DateTime",
"$value": "2020-04-23T00:00:00Z"
},
"http://schemas.microsoft.com/identity/claims/objectidentifier": {
"$type": "System.String",
"$value": "55c8c7b6-7ace-43bc-918f-304dfa2b6317"
},
"MetadataUpdateDate": {
"$type": "System.DateTime",
"$value": "2018-07-10T16:11:40Z"
},
"DirectoryAlias": {
"$type": "System.String",
"$value": "jtseng"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
{
"id": "7c86b535-818b-423f-b0fd-19a2e9f32710",
"descriptor": "Microsoft.TeamFoundation.Identity;S-1-9-1551374245-1725938060-2279921994-2555521242-2616350130-0-0-0-0-3",
"subjectDescriptor": "vssgp.Uy0xLTktMTU1MTM3NDI0NS0xNzI1OTM4MDYwLTIyNzk5MjE5OTQtMjU1NTUyMTI0Mi0yNjE2MzUwMTMwLTAtMC0wLTAtMw",
"providerDisplayName": "[jtseng]\\Project Collection Valid Users",
"isActive": true,
"isContainer": true,
"members": [],
"memberOf": [],
"memberIds": [],
"properties": {
"SchemaClassName": {
"$type": "System.String",
"$value": "Group"
},
"Description": {
"$type": "System.String",
"$value": "This application group contains all users and groups that have access to the Team Project Collection."
},
"Domain": {
"$type": "System.String",
"$value": "vstfs:///Framework/IdentityDomain/8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"Account": {
"$type": "System.String",
"$value": "Project Collection Valid Users"
},
"SecurityGroup": {
"$type": "System.String",
"$value": "SecurityGroup"
},
"SpecialType": {
"$type": "System.String",
"$value": "EveryoneApplicationGroup"
},
"ScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"ScopeType": {
"$type": "System.String",
"$value": "ServiceHost"
},
"LocalScopeId": {
"$type": "System.Guid",
"$value": "8cb9df66-e487-4ad9-9852-28da9bf255b2"
},
"SecuringHostId": {
"$type": "System.Guid",
"$value": "e26baa74-481c-42bc-a78c-f2a89decc807"
},
"ScopeName": {
"$type": "System.String",
"$value": "jtseng"
},
"GlobalScope": {
"$type": "System.String",
"$value": "GlobalScope"
},
"VirtualPlugin": {
"$type": "System.String",
"$value": ""
}
},
"resourceVersion": 2,
"metaTypeId": 255
}
]
}
定义
名称 | 说明 |
---|---|
Identity | |
Identity |
标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。 |
Properties |
类将属性包表示为键值对的集合。 接受除 之外 |
Query |
Identity
名称 | 类型 | 说明 |
---|---|---|
customDisplayName |
string |
标识的自定义显示名称 ((如果有) )。 将此属性设置为空字符串将清除现有的自定义显示名称。 将此属性设置为 null 不会影响现有的持久化值 (,因为 null 值不会通过网络发送或发送到数据库) |
descriptor |
标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。 |
|
id |
string |
标识标识符。 也称为存储密钥或 VSID |
isActive |
boolean |
如果标识在组织中的任何 Azure Devops 组中具有成员身份,则其值为 True。 |
isContainer |
boolean |
如此 如果标识是一个组。 |
masterId |
string |
|
memberIds |
string[] |
标识 (组的成员的 ID 仅) 。 |
memberOf |
标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。 |
|
members |
标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。 |
|
metaTypeId |
integer |
|
properties |
类将属性包表示为键值对的集合。 接受除 之外 |
|
providerDisplayName |
string |
源标识提供者指定的标识的显示名称。 |
resourceVersion |
integer |
|
socialDescriptor |
string |
|
subjectDescriptor |
string |
Graph 实体的主题描述符。 |
uniqueUserId |
integer |
IdentityDescriptor
标识描述符是标识类型 (Windows SID、Passport) 以及唯一标识符(如 SID 或 PUID)的包装器。
名称 | 类型 | 说明 |
---|---|---|
identifier |
string |
此标识的唯一标识符,不超过 256 个字符,将持久保存。 |
identityType |
string |
描述符的类型 (,例如 Windows、Passport 等) 。 |
PropertiesCollection
类将属性包表示为键值对的集合。 接受除 之外DBNull
的所有基元类型的值 (具有TypeCode != TypeCode.Object
) 的任何类型。 Byte[]、Int32、Double、DateType 和 String 类型的值保留其类型,其他基元将重新调整为 String。 Byte[] 应为 base64 编码字符串。
名称 | 类型 | 说明 |
---|---|---|
count |
integer |
集合中的属性计数。 |
item |
object |
|
keys |
string[] |
集合中的键集。 |
values |
string[] |
集合中的值集。 |
QueryMembership
名称 | 类型 | 说明 |
---|---|---|
direct |
string |
查询将仅返回直接成员身份数据 |
expanded |
string |
查询将返回扩展的成员身份数据 |
expandedDown |
string |
查询将返回仅) (子级展开的成员身份数据 |
expandedUp |
string |
查询将仅 (父级返回扩展的成员身份数据) |
none |
string |
查询不会返回任何成员身份数据 |