[英]Federated identity creation by graph-api in Azure B2C
在 Azure B2C( https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&tabs=http )上使用用戶更新 Graph-API,我無法理解如何創建/更新身份結構。
{
"displayName": "User Name",
"givenName": "User",
"surname": "Name",
"userType": "Member",
"userPrincipalName": "cpim_uuid@mytenant.onmicrosoft.com",
...
"identities":[
{
"signInType" : "federated",
"issuer": "https://login.company.com/auth/realms/realm-qt
"issuerAssignedId" : "user.name@company.com"
},
{
"signInType" : "userPrincipalName",
"issuer": "mytenant.onmicrosoft.com"
"issuerAssignedId" : "cpim_uuid@mytenant.onmicrosoft.com"
}
]
}
我需要添加一條“signInType”作為“federated”的記錄,以及其他信息。 示例記錄是在首次用戶登錄時通過與外部 IDP 集成自動創建的。
我想在第一次登錄之前在 Azure B2C 上大量創建用戶。
• 您可以創建多個“登錄類型”為“聯合”的用戶,如下所示。 創建一個 HTTP 發布請求,以傳遞創建為聯合用戶所需的參數。 在以下所述的創建聯合用戶身份的請求中,以如下順序格式依次提及多個用戶的詳細信息。
‘ POST https://graph.microsoft.com/v1.0/users
Content-type: application/json
{
"displayName": "John Smith",
"identities": [
{
"signInType": "userName",
"issuer": "contoso.onmicrosoft.com",
"issuerAssignedId": "johnsmith"
},
{
"signInType": "emailAddress",
"issuer": "contoso.onmicrosoft.com",
"issuerAssignedId": "jsmith@yahoo.com"
},
{
"signInType": "federated",
"issuer": "facebook.com",
"issuerAssignedId": "5eecb0cd"
}
],
"passwordProfile" : {
"password": "password-value",
"forceChangePasswordNextSignIn": false
},
"passwordPolicies": "DisablePasswordExpiration"
} ‘
圖 API 中上述請求的響應如下: -
‘ HTTP/1.1 201 Created
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"displayName": "John Smith",
"id": "4c7be08b-361f-41a8-b1ef-1712f7a3dfb2",
"identities": [
{
"signInType": "userName",
"issuer": "contoso.onmicrosoft.com",
"issuerAssignedId": "johnsmith"
},
{
"signInType": "emailAddress",
"issuer": "contoso.onmicrosoft.com",
"issuerAssignedId": "jsmith@yahoo.com"
},
{
"signInType": "federated",
"issuer": "facebook.com",
"issuerAssignedId": "5eecb0cd"
}
],
"passwordPolicies": "DisablePasswordExpiration"
} ‘
詳細信息請參考以下鏈接:-
https://docs.microsoft.com/en-us/graph/api/user-post-users?view=graph-rest-1.0&tabs=http
另外,請您參考以下 SO 社區線程以獲取更多信息:-
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.