use of com.tremolosecurity.proxy.auth.util.LDAPBasicAuth in project OpenUnison by TremoloSecurity.
the class BasicAuth method doFilter.
@Override
public void doFilter(HttpFilterRequest request, HttpFilterResponse response, HttpFilterChain chain) throws Exception {
HashMap<String, Attribute> authParams = new HashMap<String, Attribute>();
authParams.put("realmName", new Attribute("realmName", this.realmName));
authParams.put("uidAttr", new Attribute("uidAttr", this.uidAttrName));
request.getSession().setAttribute(ProxyConstants.AUTH_MECH_PARAMS, authParams);
AuthStep as = new AuthStep();
as.setId(0);
as.setExecuted(true);
as.setRequired(true);
if (com.tremolosecurity.proxy.auth.BasicAuth.checkBasicAuth(request.getServletRequest(), response.getServletResponse(), cfgMgr, new LDAPBasicAuth(), as)) {
request.removeHeader("Authorization");
chain.nextFilter(request, response, chain);
} else {
chain.setNoProxy(true);
}
}
use of com.tremolosecurity.proxy.auth.util.LDAPBasicAuth in project OpenUnison by TremoloSecurity.
the class BasicAuth method init.
@Override
public void init(ServletContext ctx, HashMap<String, Attribute> init) {
this.cfgMgr = (ConfigManager) ctx.getAttribute(ProxyConstants.TREMOLO_CONFIG);
this.authImpl = new LDAPBasicAuth();
}
Aggregations