Skip to content

Commit

Permalink
updated security handlers for REST after cxf upgrade..
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Jul 22, 2014
1 parent d965c2b commit eb79d5c
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -27,6 +27,7 @@
import org.apache.cxf.configuration.security.AuthorizationPolicy;
import org.apache.cxf.jaxrs.model.ClassResourceInfo;
import org.apache.cxf.jaxrs.model.OperationResourceInfo;
import org.apache.cxf.jaxrs.utils.JAXRSUtils;
import org.apache.cxf.message.Message;
import org.springframework.beans.factory.annotation.Autowired;

Expand All @@ -51,7 +52,7 @@ public class MidpointRestAuthenticationHandler implements ContainerRequestFilter
@Autowired(required = true)
private Protector protector;

public Response handleRequest(Message m, ClassResourceInfo resourceClass) {
public Response handleRequest(Message m) {
AuthorizationPolicy policy = (AuthorizationPolicy)m.get(AuthorizationPolicy.class);

OperationResourceInfo ori = m.getExchange().get(OperationResourceInfo.class);
Expand Down Expand Up @@ -137,20 +138,24 @@ public Response handleRequest(Message m, ClassResourceInfo resourceClass) {
}
//
// @Override
// public Response handleResponse(Message m, OperationResourceInfo ori, Response response) {
// public Response handleResponse(Message m, Response response) {
// securityEnforcer.setupPreAuthenticatedSecurityContext((PrismObject) null);
// return null;
// }

@Override
public void filter(ContainerRequestContext arg0, ContainerResponseContext arg1) throws IOException {
// TODO Auto-generated method stub
Message m = JAXRSUtils.getCurrentMessage();
handleRequest(m);

// handleResponse(m, ori, response)

}

@Override
public void filter(ContainerRequestContext arg0) throws IOException {
// TODO Auto-generated method stub
Message m = JAXRSUtils.getCurrentMessage();
handleRequest(m);

}

Expand Down

0 comments on commit eb79d5c

Please sign in to comment.