Sorry, was planning to reply a bit later. The current workaround is to implement a custom
org.apache.cxf.security.SecurityContext and register it on the inbound message and it will be wrapped by the jaxrs one and injected into the code. That said, the idea of checking the custom (jaxrs) contexts first offers a simple and effective way to support custom contexts. I'll try to look into it before 2.3 is out thanks, Sergey On Thu, Sep 9, 2010 at 5:29 PM, Obele, Azubuko < [email protected]> wrote: > Digging through the code it seems there's a method > JAXRSUtils.createContextValue which is where the SecurityContextImpl class > is actually being created. This is a static method so it's not possible to > override. > > Is there no way for me to have my own javax.ws.rs.core.SecurityContext > injected into my service methods? > > > > -----Original Message----- > From: Obele, Azubuko (GWMG Technology) > Sent: Thursday, September 09, 2010 11:04 AM > To: [email protected] > Subject: How to inject custom jaxrs.core.SecurityContext? > > Hey, > > I have my own one-off SecurityContext implementation. I would like to have > CXF JAXRS inject this into some of my service methods using the @Context > annotation. I thought this would be as simple as writing my own interceptor > and putting my SecurityContext in the message (via Message.put) or in the > Exchange (via Exchange.put) but when I do this the injected SecurityContext > is always null. > > Any ideas? > > > -------------------------------------------------------------------------- > Important Notice to Recipients: > > It is important that you do not use e-mail to request, authorize or effect > the purchase or sale of any security or commodity, to send fund transfer > instructions, or to effect any other transactions. Any such request, orders, > or instructions that you send will not be accepted and will not be processed > by Morgan Stanley Smith Barney. > > The sender of this e-mail is an employee of Morgan Stanley Smith Barney > LLC. If you have received this communication in error, please destroy all > electronic and paper copies and notify the sender immediately. Erroneous > transmission is not intended to waive confidentiality or privilege. Morgan > Stanley Smith Barney reserves the right, to the extent permitted under > applicable law, to monitor electronic communications. By e-mailing with > Morgan Stanley Smith Barney you consent to the foregoing. > > -------------------------------------------------------------------------- > Important Notice to Recipients: > > It is important that you do not use e-mail to request, authorize or effect > the purchase or sale of any security or commodity, to send fund transfer > instructions, or to effect any other transactions. Any such request, orders, > or instructions that you send will not be accepted and will not be processed > by Morgan Stanley Smith Barney. > > The sender of this e-mail is an employee of Morgan Stanley Smith Barney > LLC. If you have received this communication in error, please destroy all > electronic and paper copies and notify the sender immediately. Erroneous > transmission is not intended to waive confidentiality or privilege. Morgan > Stanley Smith Barney reserves the right, to the extent permitted under > applicable law, to monitor electronic communications. By e-mailing with > Morgan Stanley Smith Barney you consent to the foregoing. >
