authentication - Implementing Security for Java Web Services with Spring and Apache CXF -
i have application runs on java spring 3. application uses restful services , spring security security. has user table , checks user credentials it. implemented web service capability application(one of customer's wanted web services instead of restful services). if possible want same authentication mechanism , want database , allow 1 user (for now-to admin) communicate web service server.
should follow same way restful authentication or there authentication , security mechanism java web services @ spring (i.e. how deal logout, how enable logout mechanism client-server web services communication)
ps: use apache-cxf.
two potential ways:
put basicauthenticationfilter or digestauthenticationfilter in front of cxf servlet.
use ws-security usernamepasswordtoken cxf , write callbackhandler a) creates usernamepasswordauthenticationtoken, b) calls authenticationmanager.authenticate() , c) stores authentication in securitycontextholder.
note above doesn't cover concept of logout since login sessions implemented cookies , above stateless approaches. if need logout should consider using oauth because can implement logout invalidating access tokens.
Comments
Post a Comment