Search in sources :

Example 1 with AcegiSecurityException

use of org.acegisecurity.AcegiSecurityException in project hudson-2.x by hudson.

the class Hudson method setSecurityRealm.

public void setSecurityRealm(SecurityRealm securityRealm) {
    if (securityRealm == null) {
        securityRealm = SecurityRealm.NO_AUTHENTICATION;
    }
    this.securityRealm = securityRealm;
    // reset the filters and proxies for the new SecurityRealm
    try {
        HudsonFilter filter = HudsonFilter.get(servletContext);
        if (filter == null) {
            // Fix for #3069: This filter is not necessarily initialized before the servlets.
            // when HudsonFilter does come back, it'll initialize itself.
            LOGGER.fine("HudsonFilter has not yet been initialized: Can't perform security setup for now");
        } else {
            LOGGER.fine("HudsonFilter has been previously initialized: Setting security up");
            filter.reset(securityRealm);
            LOGGER.fine("Security is now fully set up");
        }
    } catch (ServletException e) {
        // for binary compatibility, this method cannot throw a checked exception
        throw new AcegiSecurityException("Failed to configure filter", e) {
        };
    }
}
Also used : ServletException(javax.servlet.ServletException) HudsonFilter(hudson.security.HudsonFilter) AcegiSecurityException(org.acegisecurity.AcegiSecurityException)

Aggregations

HudsonFilter (hudson.security.HudsonFilter)1 ServletException (javax.servlet.ServletException)1 AcegiSecurityException (org.acegisecurity.AcegiSecurityException)1