簡體   English   中英

為什么 WSO2 IS 5.6.0 SCIM2 Group API 在嘗試插入或更新用戶時會拋出錯誤?

[英]Why does the WSO2 IS 5.6.0 SCIM2 Group API throw error when trying to insert or update users?

我正在嘗試使用 WSO2 身份服務器 SCIM2 API 來創建和更新用戶和組。 但是,我遇到了 Group Update API (PUT /scim2/Groups/{id}) 的問題:如果我嘗試在消息正文中插入某個用戶,該 API 總是返回 HTTP 錯誤 500(“訪問 Java 時發生錯誤安全管理器權限塊”)。

以下是重現失敗的方法:

1)首先我們創建一個用戶:

curl -X POST \
  https://auth-server:9444/scim2/Users/ \
  -H 'Accept: */*' \
  -H 'Authorization: Basic YWRtaW46YWRtaW4=' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: a43e26c0-fb00-4fa0-9482-74f62078d6b1' \
  -H 'cache-control: no-cache' \
  -d '{
    "emails": [{
        "type": "home",
        "value": "test.user@test.com.br",
        "primary": true
    }],
    "password": "test.user",
    "name": {
        "familyName": "Test",
        "givenName": "User"
    },
    "userName": "test.user"
}'

我們收到帶有正文的 HTTP 200 作為響應:

{
    "emails": [
        {
            "type": "home",
            "value": "test.user@test.com.br",
            "primary": true
        }
    ],
    "meta": {
        "created": "2019-01-09T20:41:27Z",
        "location": "https://localhost:9444/scim2/Users/14fc39fc-1b0c-4db2-9e3a-bd5c522770bb",
        "lastModified": "2019-01-09T20:41:27Z",
        "resourceType": "User"
    },
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:User",
        "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
    ],
    "name": {
        "familyName": "Test",
        "givenName": "User"
    },
    "id": "14fc39fc-1b0c-4db2-9e3a-bd5c522770bb",
    "userName": "test.user"
}

2)接下來我們創建一個組:

curl -X POST \
  https://auth-server:9444/scim2/Groups/ \
  -H 'Accept: */*' \
  -H 'Authorization: Basic YWRtaW46YWRtaW4=' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 45d2220d-d33d-42ba-8ce5-205646aa2963' \
  -H 'cache-control: no-cache' \
  -d '{
    "displayName": "Application/Test",
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
    ]
}'

我們收到帶有正文的 HTTP 200 作為響應:

{
    "displayName": "APPLICATION/Test",
    "meta": {
        "created": "2019-01-09T20:43:22Z",
        "location": "https://localhost:9444/scim2/Groups/7feb0a54-18c5-4265-bdd6-7ceecd96bf0d",
        "lastModified": "2019-01-09T20:43:22Z",
        "resourceType": "Group"
    },
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
    ],
    "id": "7feb0a54-18c5-4265-bdd6-7ceecd96bf0d"
}

3) 當我們嘗試將新創建的用戶與組關聯時,我們收到 HTTP 500 錯誤。 見下文:

curl -X PUT \
  https://auth-server:9444/scim2/Groups/7feb0a54-18c5-4265-bdd6-7ceecd96bf0d \
  -H 'Accept: */*' \
  -H 'Authorization: Basic c2NpbS5kY2xvZ2c6c2NpbS5kY2xvZ2c=' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 6db43a33-af40-452e-83eb-40f8d6e3c5e3' \
  -H 'cache-control: no-cache' \
  -d '{
    "displayName": "APPLICATION/Test",
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group"
    ],
    "members": [
        {
            "value": "14fc39fc-1b0c-4db2-9e3a-bd5c522770bb",
            "display": "test"
        }
    ]
}'

HTTP 500 錯誤:

{
    "schemas": "urn:ietf:params:scim:api:messages:2.0:Error",
    "detail": "Error occurred while accessing Java Security Manager Privilege Block",
    "status": "500"
}

對於身份驗證,我使用的是基本身份驗證,身份服務器的用戶為“admin”; 但我也嘗試創建一個具有所有可能權限的用戶,但錯誤始終相同。 在執行控制台中,我嘗試優化日志,但只顯示以下消息:

[2019-01-09 20:47:00,656] DEBUG {org.wso2.carbon.user.core.common.AbstractUserStoreManager} -  Domain: APPLICATION is passed with the claim and user store manager is loaded for the given domain name.
[2019-01-09 20:47:00,658] ERROR {org.wso2.carbon.user.core.common.AbstractUserStoreManager} -  Error occurred while accessing Java Security Manager Privilege Block

這個 Group API 真的適用於更新請求嗎?

如果有人可以提供幫助,我將不勝感激。 謝謝你。

請按如下方式更改您將用戶添加到組的請求,這對我來說很好用。

curl -v -k --user admin:admin -X PUT -d '{"displayName":"PRIMARY/manager","members":[{"value":"416aaa06-d9ed-465b-8ac4-1a321624d158", "display":"test.user"}]}' --header "Content-Type:application/json" https://localhost:9444/scim2/Groups/5d6ffce8-fab8-45ee-a407-b1cae0e4ecee

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM