public void handleMessage(Message message) throws Fault { SecurityContext sc = message.get(SecurityContext.class); if (!(sc instanceof ClaimsSecurityContext)) { throw new AccessDeniedException("Security Context is unavailable or unrecognized"); } Method method = getTargetMethod(message); if (authorize((ClaimsSecurityContext)sc, method)) { return; } throw new AccessDeniedException("Unauthorized"); }
public void handleMessage(Message message) throws Fault { SecurityContext sc = message.get(SecurityContext.class); if (!(sc instanceof ClaimsSecurityContext)) { throw new AccessDeniedException("Security Context is unavailable or unrecognized"); } Method method = getTargetMethod(message); if (authorize((ClaimsSecurityContext)sc, method)) { return; } throw new AccessDeniedException("Unauthorized"); }
throw new AccessDeniedException("Unauthorized"); throw new AccessDeniedException("Unauthorized");
protected OperationInfo getTargetOperationInfo(Message message) { BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class); if (bop != null) { return bop.getOperationInfo(); } throw new AccessDeniedException("OperationInfo is not available : Unauthorized"); }
protected OperationInfo getTargetOperationInfo(Message message) { BindingOperationInfo bop = message.getExchange().getBindingOperationInfo(); if (bop != null) { return bop.getOperationInfo(); } throw new AccessDeniedException("OperationInfo is not available : Unauthorized"); }
protected OperationInfo getTargetOperationInfo(Message message) { BindingOperationInfo bop = message.getExchange().getBindingOperationInfo(); if (bop != null) { return bop.getOperationInfo(); } throw new AccessDeniedException("OperationInfo is not available : Unauthorized"); }
protected OperationInfo getTargetOperationInfo(Message message) { BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class); if (bop != null) { return bop.getOperationInfo(); } throw new AccessDeniedException("OperationInfo is not available : Unauthorized"); }
public void handleMessage(Message message) throws Fault { SecurityContext sc = message.get(SecurityContext.class); if (sc == null) { return; } Method method = getTargetMethod(message); if (authorize(sc, method)) { return; } throw new AccessDeniedException("Unauthorized"); }
} catch (Exception e) { LOGGER.error("Exception while checking pw: " + username, e); throw new AccessDeniedException("Authorization error"); if (LOGGER.isInfoEnabled()) LOGGER.info("Bad pw for user " + username ); throw new AccessDeniedException("Not authorized");
throw new AccessDeniedException("Not able to create new user"); throw new AccessDeniedException("Not authorized");
protected Method getTargetMethod(Message m) { BindingOperationInfo bop = m.getExchange().get(BindingOperationInfo.class); if (bop != null) { MethodDispatcher md = (MethodDispatcher) m.getExchange().get(Service.class).get(MethodDispatcher.class.getName()); return md.getMethod(bop); } Method method = (Method)m.get("org.apache.cxf.resource.method"); if (method != null) { return method; } throw new AccessDeniedException("Method is not available : Unauthorized"); }
protected Method getTargetMethod(Message m) { BindingOperationInfo bop = m.getExchange().get(BindingOperationInfo.class); if (bop != null) { MethodDispatcher md = (MethodDispatcher) m.getExchange().get(Service.class).get(MethodDispatcher.class.getName()); return md.getMethod(bop); } Method method = (Method)m.get("org.apache.cxf.resource.method"); if (method != null) { return method; } throw new AccessDeniedException("Method is not available : Unauthorized"); }
protected Method getTargetMethod(Message m) { BindingOperationInfo bop = m.getExchange().getBindingOperationInfo(); if (bop != null) { MethodDispatcher md = (MethodDispatcher) m.getExchange().getService().get(MethodDispatcher.class.getName()); return md.getMethod(bop); } Method method = (Method)m.get("org.apache.cxf.resource.method"); if (method != null) { return method; } throw new AccessDeniedException("Method is not available : Unauthorized"); }
@Override public void handleMessage(Message message) throws Fault { OperationInfo opinfo = getTargetOperationInfo(message); SecurityContext sc = message.get(SecurityContext.class); if (sc != null && sc.getUserPrincipal() != null) { if (opinfo.getName() != null && authorize(sc, opinfo.getName().getLocalPart())) { return; } } else if (!isMethodProtected(opinfo.getName().getLocalPart()) && isAllowAnonymousUsers()) { return; } throw new AccessDeniedException("Unauthorized"); }
protected Method getTargetMethod(Message m) { BindingOperationInfo bop = m.getExchange().getBindingOperationInfo(); if (bop != null) { MethodDispatcher md = (MethodDispatcher) m.getExchange().getService().get(MethodDispatcher.class.getName()); return md.getMethod(bop); } Method method = (Method)m.get("org.apache.cxf.resource.method"); if (method != null) { return method; } throw new AccessDeniedException("Method is not available : Unauthorized"); }
public void handleMessage(Message message) throws Fault { Method method = getTargetMethod(message); SecurityContext sc = message.get(SecurityContext.class); if (sc != null && sc.getUserPrincipal() != null) { if (authorize(sc, method)) { return; } } else if (!isMethodProtected(method) && isAllowAnonymousUsers()) { return; } throw new AccessDeniedException("Unauthorized"); }
protected Method getTargetMethod(Message m) { BindingOperationInfo bop = m.getExchange().getBindingOperationInfo(); if (bop != null) { MethodDispatcher md = (MethodDispatcher) m.getExchange().getService().get(MethodDispatcher.class.getName()); return md.getMethod(bop); } Method method = (Method)m.get("org.apache.cxf.resource.method"); if (method != null) { return method; } throw new AccessDeniedException("Method is not available : Unauthorized"); }
protected Method getTargetMethod(Message m) { BindingOperationInfo bop = m.getExchange().getBindingOperationInfo(); if (bop != null) { MethodDispatcher md = (MethodDispatcher) m.getExchange().getService().get(MethodDispatcher.class.getName()); return md.getMethod(bop); } Method method = (Method)m.get("org.apache.cxf.resource.method"); if (method != null) { return method; } throw new AccessDeniedException("Method is not available : Unauthorized"); }
public void handleMessage(Message message) throws Fault { Method method = getTargetMethod(message); SecurityContext sc = message.get(SecurityContext.class); if (sc != null && sc.getUserPrincipal() != null) { if (authorize(sc, method)) { return; } } else if (!isMethodProtected(method) && isAllowAnonymousUsers()) { return; } throw new AccessDeniedException("Unauthorized"); }
@Override public void handleMessage(Message message) throws Fault { OperationInfo opinfo = getTargetOperationInfo(message); SecurityContext sc = message.get(SecurityContext.class); if (sc != null && sc.getUserPrincipal() != null) { if (opinfo.getName() != null && authorize(sc, opinfo.getName().getLocalPart())) { return; } } else if (!isMethodProtected(opinfo.getName().getLocalPart()) && isAllowAnonymousUsers()) { return; } throw new AccessDeniedException("Unauthorized"); }