简体   繁体   English

WSO2 ESB获取认证名称

[英]WSO2 ESB Get Authentification Name

I'm using a ESB-Proxy with https Authentification. 我正在使用带有https Authentification的ESB代理。

If I send a message to this proxy with curl i get this log: 如果我用curl向这个代理发送消息,我会得到这个日志:

[2013-06-14 13:56:05,138]  INFO - LogMediator To: /services/Username, From: 127.0.0.1, Direction: request, Envelope: <?x
ml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="true">
<wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="Timestamp17"><wsu:Created>2013-06-14T11:56:05.134Z</wsu:Created>
<wsu:Expires>2013-06-14T12:01:05.134Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="UsernameToken16">
<wsse:Username>admin</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">admin</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body/>
</soapenv:Envelope>

Now I like to save the Username with the Property-Mediator. 现在我想用Property-Mediator保存用户名。 The problem is that I don't know how the expression has to look like. 问题是我不知道表达式是怎样的。 At the moment I have the following not working expression: 目前我有以下不工作的表达方式:

<property xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="user" expression="//soapenv:Envelope/soapenv:Header/wsse:Security/wsse:UsernameToken/wsse:Username" scope="transport" type="STRING"/>

What's the correct expression for getting the username? 获取用户名的正确表达方式是什么?

Thank you. 谢谢。

您可以使用带有$ header的espression来检索用户名,如下所示。

<property xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" name="user" expression="$header/wsse:Security/wsse:UsernameToken/wsse:Username"/>

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

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