Identities - Read Identities
解決舊版身分識別資訊,以搭配舊版 API 使用,例如安全性 API
GET https://vssps.dev.azure.com/{organization}/_apis/identities?api-version=7.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
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
organization
|
path |
string |
Azure DevOps 組織的名稱。 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。 |
descriptors
|
query |
string |
要解析之識別描述元的逗號分隔清單 |
|
filter
|
query |
string |
搜尋值,如 searchFilter 所指定。 |
|
identity
|
query |
string |
要解析的記憶體金鑰逗號分隔清單 |
|
query
|
query |
要包含在身分識別中的成員資格資訊。 沒有成員資格數據的值可以是 None,或直接包含身分識別所屬的群組,以及屬於此身分識別的身分識別(僅限群組) |
||
search
|
query |
string |
要執行的搜尋類型。 值可以是 AccountName (domain\alias)、DisplayName、MailAddress、General(顯示名稱、帳戶名稱或唯一名稱),或 LocalGroupName(僅搜尋 Azure Devops 群組)。 |
|
subject
|
query |
string |
要解析之主體描述元的逗號分隔清單 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
Identity[] |
成功作業 |
安全性
oauth2
類型:
oauth2
Flow:
accessCode
授權 URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
權杖 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
範圍
名稱 | Description |
---|---|
vso.identity | 授與讀取身分識別和群組的能力。 |
範例
By Email |
By Identity |
By Ids |
By Name |
By Subject Descriptors |
By Email
範例要求
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?searchFilter=General&filterValue=jtseng@vscsi.us&queryMembership=None&api-version=7.1
範例回覆
{
"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
範例要求
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
範例回覆
{
"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
範例要求
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?identityIds=81fa638908726fdda4517ba7880f566a,7c86b535818b423fb0fd19a2e9f32710&queryMembership=None&api-version=7.1
範例回覆
{
"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
範例要求
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?searchFilter=General&filterValue=Project Collection Valid Users&queryMembership=None&api-version=7.1
範例回覆
{
"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
範例要求
GET https://vssps.dev.azure.com/fabrikam/_apis/identities?subjectDescriptors=aad.MDA0NzBlMzQtZGE2MS03YTY5LWJkOTYtNDg3YTg0OWVjNTU4,vssgp.Uy0xLTktMTU1MTM3NDI0NS0xNzI1OTM4MDYwLTIyNzk5MjE5OTQtMjU1NTUyMTI0Mi0yNjE2MzUwMTMwLTAtMC0wLTAtMw&queryMembership=None&api-version=7.1
範例回覆
{
"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 (uuid) |
識別標識碼。 也稱為記憶體金鑰或 VSID |
isActive |
boolean |
如果身分識別在組織中任何 Azure Devops 群組中具有成員資格,則為 True。 |
isContainer |
boolean |
如果身分識別是群組,則為 True。 |
masterId |
string (uuid) |
|
memberIds |
string[] (uuid) |
身分識別成員的標識碼(僅限群組)。 |
memberOf |
身分識別描述元是識別類型 (Windows SID, Passport) 的包裝函式,以及 SID 或 PUID 等唯一識別碼。 |
|
members |
身分識別描述元是識別類型 (Windows SID, Passport) 的包裝函式,以及 SID 或 PUID 等唯一識別碼。 |
|
metaTypeId |
integer (int32) |
|
properties |
類別會將屬性包表示為索引鍵/值組的集合。 接受 |
|
providerDisplayName |
string |
來源識別提供者所指定之身分識別的顯示名稱。 |
resourceVersion |
integer (int32) |
|
socialDescriptor |
string |
|
subjectDescriptor |
string |
Graph 實體的主體描述元。 |
uniqueUserId |
integer (int32) |
IdentityDescriptor
身分識別描述元是識別類型 (Windows SID, Passport) 的包裝函式,以及 SID 或 PUID 等唯一識別碼。
名稱 | 類型 | Description |
---|---|---|
identifier |
string |
此身分識別的唯一標識符,不超過 256 個字元,這會保存。 |
identityType |
string |
描述項的類型(例如 Windows、Passport 等)。 |
PropertiesCollection
類別會將屬性包表示為索引鍵/值組的集合。 接受 DBNull
以外的所有基本類型值(任何具有 TypeCode != TypeCode.Object
的類型)。 Byte[]、Int32、Double、DateType 和 String 類型的值會保留其類型,其他基本類型會重新調整為 String。 Byte[] 預期為base64編碼字串。
名稱 | 類型 | Description |
---|---|---|
count |
integer (int32) |
集合中的屬性計數。 |
item |
object |
|
keys |
string[] |
集合中的索引鍵集合。 |
values |
string[] |
集合中的值集合。 |
QueryMembership
值 | Description |
---|---|
direct |
查詢只會傳回直接成員資格數據 |
expanded |
查詢會傳回展開的成員資格數據 |
expandedDown |
查詢會傳回已展開的成員資格數據(僅限子系) |
expandedUp |
查詢會傳回擴充的成員資格數據(僅限父系) |
none |
查詢不會傳回任何成員資格數據 |