WSO2身份服务器(IS-KM 5.10.0)-无法使用RemoteUserStoreManagerService在租户下添加声明和角色

时间:2020-11-02 10:56:48

标签: wso2 wso2is

我正在使用TenantMgtAdminService创建租户,并使用中介顺序,我正在尝试使用RemoteUserStoreManagerService向租户管理员添加声明。

租户创建SOAP请求:

Public Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Locatie_05Kuipers As String
        If System.IO.File.ReadAllText(Pathfile) = "" Then
            'If System.IO.File.ReadAllText("C:\testing1\testing2\testing7\testing1\testing1\text.txt") = "" Then

            Locatie_05Kuipers = InputBox("Vul hier de Locatie waar je start bestanden moeten staan. Bijvoorbeeld: K:\Inventor\Instalprogram\ ")

            If System.IO.File.Exists(Pathfile) Then
                System.IO.File.Delete(Pathfile)
            End If

            Dim objStreamWriter As StreamWriter
            objStreamWriter = New StreamWriter(Pathfile)
            objStreamWriter.WriteLine(Locatie_05Kuipers & "\03 - Locaties")
            objStreamWriter.Close()

            ButtonInstal.Visible = True
            Exit Sub
        Else
        End If

设置声明SOAP请求:

        <payloadFactory media-type="xml">
            <format>
               <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.mgt.tenant.carbon.wso2.org" xmlns:xsd="http://beans.common.stratos.carbon.wso2.org/xsd">
                  <soapenv:Body>
                     <ser:addTenant>
                        <ser:tenantInfoBean>
                           <xsd:active>true</xsd:active>
                           <xsd:admin>$1</xsd:admin>
                           <xsd:adminPassword>$2</xsd:adminPassword>
                           <xsd:email>$3</xsd:email>
                           <xsd:firstname>$4</xsd:firstname>
                           <xsd:lastname>$5</xsd:lastname>
                           <xsd:tenantDomain>$6</xsd:tenantDomain>
                           <xsd:usagePlan>demo</xsd:usagePlan>
                        </ser:tenantInfoBean>
                     </ser:addTenant>
                  </soapenv:Body>
               </soapenv:Envelope>
            </format>
            <args>
               <arg evaluator="xml" expression="get-property('tenantAdminName')" />
               <arg evaluator="xml" expression="get-property('tenantAdminPassword')" />
               <arg evaluator="xml" expression="get-property('tenantEmailAddress')" />
               <arg evaluator="xml" expression="get-property('tenantFirstName')" />
               <arg evaluator="xml" expression="get-property('tenantLastName')" />
               <arg evaluator="xml" expression="get-property('tenantDomain')" />
            </args>
         </payloadFactory>
         <property name="HTTP_METHOD" scope="axis2" type="STRING" value="POST" />
         <header name="SOAPAction" scope="transport" value="ser:getTenant" />
         <property action="remove" name="REST_URL_POSTFIX" scope="axis2" />
         <property name="messageType" scope="axis2" type="STRING" value="application/xml" />
         <property name="ContentType" scope="axis2" type="STRING" value="application/xml" />
         <property expression="fn:concat('Basic ', 'YWRtaW46YWRtaW4=')" name="Authorization" scope="transport" type="STRING" />
         <call blocking="true">
            <endpoint>
               <address uri="https://is-km:9443/services/TenantMgtAdminService" />
            </endpoint>
         </call>

每当我创建一个租户时,声明将被存储一次,并且从第二次失败(随后我随后创建另一个/新的租户)时,将出现以下错误-“ 30007-UserNotFound:用户tenant493不存在在:PRIMARY”中。

角色创建SOAP请求:

              <payloadFactory media-type="xml">
                  <format>
                     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org" xmlns:xsd="http://common.mgt.user.carbon.wso2.org/xsd">
                        <soapenv:Header />
                        <soapenv:Body>
                           <ser:setUserClaimValues>
                              <ser:userName>$1</ser:userName>
                              <ser:claims>
                                 <xsd:claimURI>http://wso2.org/claims/url</xsd:claimURI>
                                 <xsd:value>SP5d001554-f331-11ea-adc1-0242ac120002</xsd:value>
                              </ser:claims>
                              <ser:claims>
                                 <xsd:claimURI>http://wso2.org/claims/organization</xsd:claimURI>
                                 <xsd:value>$2</xsd:value>
                              </ser:claims>
                              <ser:profileName>default</ser:profileName>
                           </ser:setUserClaimValues>
                        </soapenv:Body>
                     </soapenv:Envelope>
                  </format>
                  <args>
                     <arg evaluator="xml" expression="get-property('tenantAdminName')" />
                     <arg evaluator="xml" expression="get-property('ACID')" />
                  </args>
               </payloadFactory>
               <property name="HTTP_METHOD" scope="axis2" type="STRING" value="POST" />
               <header name="SOAPAction" scope="transport" value="ser:setUserClaimValues" />
               <property action="remove" name="REST_URL_POSTFIX" scope="axis2" />
               <property name="messageType" scope="axis2" type="STRING" value="application/xml" />
               <property name="ContentType" scope="axis2" type="STRING" value="application/xml" />
               <property expression="fn:concat('Basic ', base64Encode(fn:concat($ctx:tenantAdminName,'@',$ctx:tenantDomain,':',$ctx:tenantAdminPassword)))" name="Authorization" scope="transport" type="STRING" />
               <call blocking="true">
                  <endpoint>
                     <address uri="https://is-km:9443/services/RemoteUserStoreManagerService" />
                  </endpoint>
               </call>

创建角色时,出现以下错误-“角色名称已存在于系统中。请选择其他角色名称。” ,即使该角色在新版中不可用创建了租户域。

这个问题即将针对其他租户创建请求。

IS-KM正在carbon.super域中对待用户,而我将新创建的租户的正确基本身份验证凭据作为Basic base64Encode(TenantAdminName @ TenantDomainName:TenantAdminPassword)传递

任何帮助将不胜感激。谢谢

0 个答案:

没有答案