Search code examples
securitywso2esb

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 :)


Solution

  • 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.