Apr 5, 2011

Axis2/Rampart - Access the authentication details within the service class

In certain cases, it is required to access the username of the authenticated service consumer or the alias of the certificate which was used for signature verification of the messages within the service class in Axis2/Rampart.

These information is available as properties in the Axis2 message context. You can get hold of the Axis2 message context in the following manner.

MessageContext msgCtx = MessageContext.getCurrentMessageContext();

To access the username of the authenticated user ;


(This is available since 1.5 release of Rampart.)

To access the certificate alias of the public key which was used to validate the signature of the message (In Asymmetric Binding case) ;


(This will be available from Rampart 1.6 release onwards which will be out soon)


Post a Comment