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 ;
msgCtx.getProperty(RampartMessageData.USERNAME);
(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) ;
msgCtx.getProperty(RampartMessageData.SIGNATURE_CERT_ALIAS);
(This will be available from Rampart 1.6 release onwards which will be out soon)
0 comments:
Post a Comment