use of com.tremolosecurity.proxy.auth.util.HttpBasicAuth in project OpenUnison by TremoloSecurity.
the class RemoteBasic 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", "uid"));
request.getSession().setAttribute(ProxyConstants.AUTH_MECH_PARAMS, authParams);
AuthStep as = new AuthStep();
as.setId(0);
as.setRequired(true);
if (com.tremolosecurity.proxy.auth.BasicAuth.checkBasicAuth(request.getServletRequest(), response.getServletResponse(), cfgMgr, new HttpBasicAuth(url, false, host, port), as)) {
request.removeHeader("Authorization");
chain.nextFilter(request, response, chain);
} else {
chain.setNoProxy(true);
}
}
Aggregations