[英]How to work with Primary Userstore in wso2esb
我正在使用4.8.1。 我希望使用纯文本密码对Carbon Users-tore进行身份验证。 如果我们使用Username-tokens Signature很容易,但是我的客户还有其他一些Header,例如
<soapenv:Header>
<mw:authentication soapenv:soa="http://schemas.xmlsoap.org/soap/soa/next" soapenv:mustUnderstand="0" xmlns:mw="http://soa.dev.com/mwoxy">
<mw:user>admin</mw:user>
<mw:password>admin</mw:password>
</mw:authentication>
</soapenv:Header>
所以我希望在代理内部对此进行身份验证,以便我编写了这样的代理
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="authent" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<inSequence>
<property name="username" expression="//mw:authentication/mw:user/text()" scope="default" type="STRING"/>
<property name="password" expression="//mw:authentication/mw:password/text() type="STRING"/>
<dblookup>
<connection>
<pool>
<dsName>jdbc/WSO2CarbonDB</dsName>
</pool>
</connection>
<statement>
<sql>select UM_USER_NAME from UM_USER where UM_USER_NAME=? and UM_USER_PASSWORD= ?</sql>
<parameter expression="get-property('username')" type="VARCHAR"/>
<parameter expression="get-property('password')" type="VARCHAR"/>
<result name="IsUserExisted" column="UM_USER_NAME"/>
</statement>
</dblookup>
<log level="full">
<property name="IsUserExisted" expression="get-property('IsUserExisted')"/>
</log>
</inSequence>
<outSequence/>
</target>
<description/>
</proxy>
所以我希望针对Primary UserStore进行身份验证,因为我使用了此查询
从UM_USER中选择UM_USER_NAME,其中UM_USER_NAME =? 和UM_USER_PASSWORD =吗? 并在user-mgt.xml文件中完成更改,但是由于我只有3个用户和密码,因此无法正常工作。 配置是这样的
<UserStoreManager class="org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager">
<Property name="TenantManager">org.wso2.carbon.user.core.tenant.JDBCTenantManager</Property>
<Property name="ReadOnly">false</Property>
<Property name="MaxUserNameListLength">100</Property>
<Property name="IsEmailUserName">false</Property>
<Property name="DomainCalculation">default</Property>
<!-- <Property name="PasswordDigest">SHA-256</Property>-->
<Property name="StoreSaltedPassword">true</Property>
<Property name="ReadGroups">true</Property>
<Property name="WriteGroups">true</Property>
<Property name="UserNameUniqueAcrossTenants">false</Property>
<Property name="PasswordJavaRegEx">^[\S]{5,30}$</Property>
<Property name="PasswordJavaScriptRegEx">^[\S]{5,30}$</Property>
<Property name="UsernameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\<>,\'\"]{3,30}$</Property>
<Property name="UsernameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="RolenameJavaRegEx">^[^~!#$;%^*+={}\\|\\\\<>,\'\"]{3,30}$</Property>
<Property name="RolenameJavaScriptRegEx">^[\S]{3,30}$</Property>
<Property name="UserRolesCacheEnabled">true</Property>
<Property name="MaxRoleNameListLength">100</Property>
<Property name="MaxUserNameListLength">100</Property>
<Property name="SharedGroupEnabled">false</Property>
<Property name="SCIMEnabled">false</Property>
</UserStoreManager>
它不起作用我将如何实现
提前Thnks
您使用了错误的方法。 我相信您正在尝试使用用户名和密码来保护代理服务。 因此,基本上,您可以保护代理服务器不应用用户名和密码安全策略,如[1]所示。
[1]。 https://docs.wso2.com/display/ESB481/Applying+Security+Policies
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.