I tried using AuthenticationHandler extending RequestHandler...where i write
authentication logic...
but I donnot know how to access username in my service implementation
So, I tried instead having a ServiceImpl class where I have a :
@Context MessageContext mc;
public void getInfo() {
AuthorizationPolicy policy =
(AuthorizationPolicy)mc.get(AuthorizationPolicy.class.getName());
String userName = policy.getUserName();
String password = policy.getPassword();
logger.error(userName+" "+password);
}
public Response serviceMethod() {
//do something
getInfo();
}
I am able to access the username and password..
My concern is whether MessageContext is set per service request and is value
of MessageContext jumbled up with value of some other service call (or
remains steady per request). In that case I will have to pass it as service
function parameter.
--
View this message in context:
http://cxf.547215.n5.nabble.com/Doubt-regarding-basic-http-authentication-tp4258402p4258402.html
Sent from the cxf-user mailing list archive at Nabble.com.