简体   繁体   English

使用管理员服务在wso2中分配角色

[英]assigning role in wso2 using admin service

Im trying to assign a role to a user in wso2 using admin service. 我试图使用管理员服务在wso2中为用户分配角色。 Below is request stored in setuser.xml. 下面是存储在setuser.xml中的请求。 Im using wso2 apim manager 1.10 我正在使用WSO2 API管理器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>

Above is my post request.Im getting 202 status after executing curl, but role is not added. 以上是我的发帖请求。执行curl后我的状态为202,但未添加角色。 Could you tell me where im doing wrong. 你能告诉我我做错了什么吗?

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

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

您缺少SOAPAction标头

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM