static boolean wasAuthExceptionThrown(HttpServerExchange exchange) { return exchange.getAttachment(UndertowSecurityAttachments.SECURITY_CONTEXT_ATTACHMENT).getData().get(AuthException.class.getName()) != null; }
public Object run() { //Object exception = SecurityAssociation.getContextInfo(AUTH_EXCEPTION_KEY); SecurityContext sc = getSecurityContext(); if(sc == null) throw new IllegalStateException("Security Context is null"); Object exception = sc.getData().get(AUTH_EXCEPTION_KEY) ; return exception; } }
@Override public Throwable run() { SecurityContext sc = getSecurityContext(); Throwable exception = null; if (sc != null) exception = (Throwable) sc.getData().get(AUTH_EXCEPTION_KEY); return exception; } });
@Override public Void run() { SecurityContext sc = getSecurityContext(); if (sc != null) sc.getData().put(AUTH_EXCEPTION_KEY, null); return null; } });
@Override public Throwable run() { SecurityContext sc = getSecurityContext(); Throwable exception = null; if (sc != null) exception = (Throwable) sc.getData().get(AUTH_EXCEPTION_KEY); return exception; } });
@Override public Void run() { SecurityContext sc = getSecurityContext(); if (sc != null) sc.getData().put(AUTH_EXCEPTION_KEY, null); return null; } });
@Override public Void run() { SecurityContext sc = getSecurityContext(); if (sc != null) sc.getData().put(AUTH_EXCEPTION_KEY, null); return null; } });
public Object run() { SecurityContext sc = getSecurityContext(); return sc.getData().get(EX_KEY); } });
public Object run() { SecurityContext sc = getSecurityContext(); return sc.getData().get(EX_KEY); } });
@Override public Throwable run() { SecurityContext sc = getSecurityContext(); Throwable exception = null; if (sc != null) exception = (Throwable) sc.getData().get(AUTH_EXCEPTION_KEY); return exception; } });
public Object run() { //Object exception = SecurityAssociation.setContextInfo(AUTH_EXCEPTION_KEY, null); SecurityContext sc = getSecurityContext(); if(sc == null) throw new IllegalStateException("Security Context is null"); sc.getData().put(AUTH_EXCEPTION_KEY, null); return null; //return exception; } }
@Override public Throwable run() { SecurityContext sc = getSecurityContext(); Throwable exception = null; if (sc != null) exception = (Throwable) sc.getData().get(AUTH_EXCEPTION_KEY); return exception; } });
@SuppressWarnings("unchecked") @Override public <T> T get(String key) { validateSecurityContext(); if(RUNAS_IDENTITY_IDENTIFIER.equals(key)) return (T)securityContext.getOutgoingRunAs(); else return (T) securityContext.getData().get(key); }
@SuppressWarnings("unchecked") @Override public <T> T get(String key) { validateSecurityContext(); if(RUNAS_IDENTITY_IDENTIFIER.equals(key)) return (T)securityContext.getOutgoingRunAs(); else return (T) securityContext.getData().get(key); }
private void setRunAsIdentity(RunAsIdentity rai) { Map<String,Object> contextMap = securityContext.getData(); //Move the current RAI on the sc into the caller rai RunAs currentRA = securityContext.getOutgoingRunAs(); contextMap.put(CALLER_RAI_IDENTIFIER, currentRA); securityContext.setOutgoingRunAs(rai); }
private void setRunAsIdentity(RunAsIdentity rai) { Map<String,Object> contextMap = securityContext.getData(); //Move the current RAI on the sc into the caller rai RunAs currentRA = securityContext.getOutgoingRunAs(); contextMap.put(CALLER_RAI_IDENTIFIER, currentRA); securityContext.setOutgoingRunAs(rai); }
public Object run() { //Set it on the current security context also SecurityContext sc = SecurityContextAssociation.getSecurityContext(); if(sc != null) { sc.getData().put(key, value); } return SecurityContextAssociation.setContextInfo(key, value); } }
public Object run() { //Set it on the current security context also SecurityContext sc = SecurityContextAssociation.getSecurityContext(); if(sc != null) { sc.getData().put(key, value); } return SecurityContextAssociation.setContextInfo(key, value); } }
public Object run() { //Set it on the current security context also SecurityContext sc = SecurityContextAssociation.getSecurityContext(); if(sc != null) { sc.getData().put(key, value); } return SecurityAssociation.setContextInfo(key, value); } }
public Object run() { //Set it on the current security context also SecurityContext sc = SecurityContextAssociation.getSecurityContext(); if(sc != null) { sc.getData().put(key, value); } return SecurityAssociation.setContextInfo(key, value); } }