muetze
muetze

Reputation: 161

WSO2 ESB Get Username

I like to use a proxy with authentification via username and password. All the messages going over the ESB should be saved into a Database, including the user which is authenticated to the ESB. Is there a way to get the username in the proxy? I know you can get the message-id for example, but I couldn't find a solution to get the username.

Maybe you can help me :)

Upvotes: 1

Views: 1376

Answers (4)

muetze
muetze

Reputation: 161

It's working if you use $header to access the header information. Just get the xPath and extract the username like this example:

<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"/>

Upvotes: 1

Asela
Asela

Reputation: 5821

Once proxy service is secured user name token or basic auth... After successful message authentication, user name can be retrieved. User name can be retrieved from axis2 message context using property called "username". You can use property mediator (scope is axis2) or simple class mediator.

Upvotes: 0

Chanaka udaya
Chanaka udaya

Reputation: 5316

I think you can get help from the ESB documentation here http://docs.wso2.org/wiki/display/ESB460/HTTP+Basic+Authentication+over+a+Proxy+Server

Upvotes: 0

Ratha
Ratha

Reputation: 9692

You can secure proxies using username token(ie: username/password). Go to service dashboard-->security option and you can find the tools to enable username token. If you secured like that, in your request you should send the basic auth header.

Upvotes: 0

Related Questions