使用admin服务在wso2中分配角色

时间:2017-07-12 15:06:47

标签: wso2 wso2-am

我尝试使用admin服务在wso2中为用户分配角色。以下是存储在setuser.xml中的请求。我正在使用wso2 apim manager 1.10

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://common.mgt.user.carbon.wso2.org/xsd">
  <soap:Header/>
   <soap:Body>
  <ser:setUserClaimValues>
     <!--Optional:-->
     <ser:userName>test123</ser:userName>

      <ser:claims>
        <!--Optional:-->
        <xsd:claimURI>http://wso2.org/claims/role</xsd:claimURI>
        <!--Optional:-->
        <xsd:value>Internal/publisher</xsd:value>
     </ser:claims>

  </ser:setUserClaimValues>

以上是我的帖子请求。执行curl后获得202状态,但未添加角色。你能告诉我我做错了吗?

curl -i -k --header "Content-Type: application/soap+xml" -H "Authorization: 
Basic xxxxxxxxxx" -X POST 
https://xxxxx:9443/services/RemoteUserStoreManagerService -d @setuser.xml
HTTP/1.1 202 Accepted
Set-Cookie: JSESSIONID=83C74EE8FC35CAE7D015FA32803440BE; Path=/; Secure; 
HttpOnly
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked

日期:2017年7月12日星期三15:03:08 GMT    服务器:WSO2 Carbon Server

1 个答案:

答案 0 :(得分:0)

您缺少curl -k -H "Content-Type: application/soap+xml;charset=UTF-8;" -H "SOAPAction:urn:setUserClaimValues" --basic -u "admin:admin" --data @setuser.xml https://localhost:9443/services/RemoteUserStoreManagerService 标题

{{1}}