Search in sources :

Example 1 with LDAPBasicAuth

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);
    }
}
Also used : LDAPBasicAuth(com.tremolosecurity.proxy.auth.util.LDAPBasicAuth) Attribute(com.tremolosecurity.saml.Attribute) HashMap(java.util.HashMap) AuthStep(com.tremolosecurity.proxy.auth.util.AuthStep)

Example 2 with LDAPBasicAuth

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();
}
Also used : LDAPBasicAuth(com.tremolosecurity.proxy.auth.util.LDAPBasicAuth)

Aggregations

LDAPBasicAuth (com.tremolosecurity.proxy.auth.util.LDAPBasicAuth)2 AuthStep (com.tremolosecurity.proxy.auth.util.AuthStep)1 Attribute (com.tremolosecurity.saml.Attribute)1 HashMap (java.util.HashMap)1