我用天蓝色的神甫做了个帕特。现在我已经创建了一个react应用程序来处理所有的api逻辑。我现在有一个登录屏幕,用户需要输入DEVOPS_TOKEN,ORGANISATION_NAME。如何在登录时验证用户令牌。我找不到任何api来验证用户。
任何建议都会有帮助。
发布于 2018-11-09 14:11:17
经过一番调查,我找到了一种验证用户的方法。有一个在Azure中可用的api:https://dev.azure.com/{ORGANISATION_NAME}/_apis/connectionData.
需要在导致用户授权的标头参数中传递编码的令牌。
{
"authenticatedUser": {
"id": "123-13-131231231-123-123-123-123",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;123-13-131231231-123-123-123-123\\user@domain.com",
"subjectDescriptor": "aad.Masdasdpadspoadsjpaodsjapodj",
"providerDisplayName": "User Name",
"isActive": true,
"properties": {
"Account": {
"$type": "System.String",
"$value": "user@domain.com"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
"authorizedUser": {
"id": "123-13-131231231-123-123-123-123",
"descriptor": "Microsoft.IdentityModel.Claims.ClaimsIdentity;123-13-131231231-123-123-123-123\\user@domain.com",
"subjectDescriptor": "aad.Masdasdpadspoadsjpaodsjapodj",
"providerDisplayName": "User Name",
"isActive": true,
"properties": {
"Account": {
"$type": "System.String",
"$value": "user@domain.com"
}
},
"resourceVersion": 2,
"metaTypeId": 0
},
"instanceId": "123-13-131231231-123-123-123-123",
"deploymentId": "123-13-131231231-123-123-123-123",
"deploymentType": "hosted",
"locationServiceData": {
"serviceOwner": "123-13-131231231-123-123-123-123",
"defaultAccessMappingMoniker": "PublicAccessMapping",
"lastChangeId": 12313123,
"lastChangeId64": 123123123
}
}https://stackoverflow.com/questions/53190769
复制相似问题