如何在wso2中授权特定用户?

时间:2017-06-06 09:00:04

标签: authentication wso2 authorization wso2esb wso2ei

我正在使用Enterprise Integrator。我想授权自定义用户,使用身份验证服务来访问令牌。我曾尝试过“代理服务”方法。但它没有用。

我该怎么做?

    <soapenv:Fault xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:axis2ns7="http://www.w3.org/2003/05/soap-envelope">
  <soapenv:Code>
  <soapenv:Value>axis2ns7:Sender</soapenv:Value>
  <soapenv:Subcode>
    <soapenv:Value xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">wsse:InvalidSecurity</soapenv:Value>
  </soapenv:Subcode>
</soapenv:Code>
<soapenv:Reason>
  <soapenv:Text xml:lang="en-US">Expected transport is "https" but incoming transport found : "http" </soapenv:Text>
</soapenv:Reason>
<soapenv:Detail/>
</soapenv:Fault>

1 个答案:

答案 0 :(得分:1)

要在WSO2中保护代理服务,您应该使用安全策略。

注意:在代理服务受到保护后,您应该使用https传输来访问代理服务并在soap标头中添加所需的身份验证令牌:

  <soapenv:Header>
      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">

         <wsse:UsernameToken wsu:Id="UsernameToken-7DEBB9BDD57CC8619914970188232131">
            <wsse:Username>username</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">TVea2PRqvZrMuX3edayHPGMHaB8=</wsse:Password>
            <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">cRkZQr9inPo9JbrD+nselw==</wsse:Nonce>
            <wsu:Created>2017-06-09T14:33:43.212Z</wsu:Created>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>

您可以使用管理控制台添加用户和角色:配置 - 用户和角色。您还可以从其他用户存储中导入用户:配置 - 用户存储(或者,通过修改WSO2EI_FOLDER / conf / user-mgt.xml)。