View | Details | Raw Unified | Return to bug 60202
Collapse All | Expand All

(-)java/org/apache/catalina/Realm.java (+9 lines)
Lines 231-234 Link Here
231
     * @return principal roles
231
     * @return principal roles
232
     */
232
     */
233
    public String[] getRoles(Principal principal);
233
    public String[] getRoles(Principal principal);
234
235
236
    /**
237
     * Return the availability of the realm for authentication.
238
     * @return <code>true</code> if the realm is able to perform authentication
239
     */
240
    default public boolean isUp() {
241
        return true;
242
    }
234
}
243
}
(-)java/org/apache/catalina/realm/CombinedRealm.java (+11 lines)
Lines 418-421 Link Here
418
        throw uoe;
418
        throw uoe;
419
    }
419
    }
420
420
421
422
    @Override
423
    public boolean isUp() {
424
        for (Realm realm : realms) {
425
            if (!realm.isUp()) {
426
                return false;
427
            }
428
        }
429
        return true;
430
    }
431
421
}
432
}
(-)java/org/apache/catalina/realm/JNDIRealm.java (+7 lines)
Lines 2379-2384 Link Here
2379
2379
2380
    }
2380
    }
2381
2381
2382
    
2383
    @Override
2384
    public boolean isUp() {
2385
        // Simple best effort check
2386
        return (context != null);
2387
    }
2388
2382
    private DirContext createDirContext(Hashtable<String, String> env) throws NamingException {
2389
    private DirContext createDirContext(Hashtable<String, String> env) throws NamingException {
2383
        if (useStartTls) {
2390
        if (useStartTls) {
2384
            return createTlsDirContext(env);
2391
            return createTlsDirContext(env);
(-)java/org/apache/catalina/realm/LockOutRealm.java (-1 / +1 lines)
Lines 212-218 Link Here
212
     */
212
     */
213
    private Principal filterLockedAccounts(String username, Principal authenticatedUser) {
213
    private Principal filterLockedAccounts(String username, Principal authenticatedUser) {
214
        // Register all failed authentications
214
        // Register all failed authentications
215
        if (authenticatedUser == null) {
215
        if (authenticatedUser == null && isUp()) {
216
            registerAuthFailure(username);
216
            registerAuthFailure(username);
217
        }
217
        }
218
218

Return to bug 60202