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 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
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 |
要解析之主體描述元的逗號分隔清單 |
回應
名稱 | 類型 | Description |
---|---|---|
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
名稱 | Description |
---|---|
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
}
]
}
定義
名稱 | Description |
---|---|
Identity | |
Identity |
身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。 |
Properties |
類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 |
Query |
Identity
名稱 | 類型 | Description |
---|---|---|
customDisplayName |
string |
如果有任何) ,則為身分識別的自訂顯示名稱 (。 將此屬性設定為空字串將會清除現有的自訂顯示名稱。 將此屬性設定為 null 不會影響現有的保存值 (,因為 Null 值不會透過網路傳送或傳送至資料庫) |
descriptor |
身分識別描述元是識別類型的包裝函式, (Windows SID、Passport) 以及 SID 或 PUID 等唯一識別碼。 |
|
id |
string |
識別識別碼。 也稱為儲存體金鑰或 VSID |
isActive |
boolean |
如果身分識別具有組織中任何 Azure Devops 群組的成員資格,則為 True。 |
isContainer |
boolean |
如果身分識別是群組,則為 True。 |
masterId |
string |
|
memberIds |
string[] |
只有) 的身分識別 (群組成員識別碼。 |
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 等唯一識別碼。
名稱 | 類型 | Description |
---|---|---|
identifier |
string |
此身分識別的唯一識別碼,不超過 256 個字元,將會保存。 |
identityType |
string |
描述項的類型 (例如 Windows、Passport 等) 。 |
PropertiesCollection
類別會將屬性包表示為索引鍵/值組的集合。 所有基本類型的值都會 (接受任何具有 TypeCode != TypeCode.Object
) DBNull
的型別。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型則會重新調整為 String。 Byte[] 預期為 base64 編碼字串。
名稱 | 類型 | Description |
---|---|---|
count |
integer |
集合中的屬性計數。 |
item |
object |
|
keys |
string[] |
集合中的索引鍵集合。 |
values |
string[] |
集合中的值集合。 |
QueryMembership
名稱 | 類型 | Description |
---|---|---|
direct |
string |
查詢只會傳回直接成員資格資料 |
expanded |
string |
查詢會傳回展開的成員資格資料 |
expandedDown |
string |
查詢只會傳回子系 (展開的成員資格資料) |
expandedUp |
string |
查詢只會) 傳回父系 (展開的成員資格資料 |
none |
string |
查詢不會傳回任何成員資格資料 |