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

(-)java/org/apache/catalina/authenticator/SpnegoAuthenticator.java (-7 / +7 lines)
Lines 149-155 Link Here
149
            if (log.isDebugEnabled()) {
149
            if (log.isDebugEnabled()) {
150
                log.debug(sm.getString("authenticator.noAuthHeader"));
150
                log.debug(sm.getString("authenticator.noAuthHeader"));
151
            }
151
            }
152
            response.setHeader("WWW-Authenticate", "Negotiate");
152
            response.setHeader(AUTH_HEADER_NAME, "Negotiate");
153
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
153
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
154
            return false;
154
            return false;
155
        }
155
        }
Lines 162-168 Link Here
162
                log.debug(sm.getString(
162
                log.debug(sm.getString(
163
                        "spnegoAuthenticator.authHeaderNotNego"));
163
                        "spnegoAuthenticator.authHeaderNotNego"));
164
            }
164
            }
165
            response.setHeader("WWW-Authenticate", "Negotiate");
165
            response.setHeader(AUTH_HEADER_NAME, "Negotiate");
166
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
166
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
167
            return false;
167
            return false;
168
        }
168
        }
Lines 182-188 Link Here
182
                log.debug(sm.getString(
182
                log.debug(sm.getString(
183
                        "spnegoAuthenticator.authHeaderNoToken"));
183
                        "spnegoAuthenticator.authHeaderNoToken"));
184
            }
184
            }
185
            response.setHeader("WWW-Authenticate", "Negotiate");
185
            response.setHeader(AUTH_HEADER_NAME, "Negotiate");
186
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
186
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
187
            return false;
187
            return false;
188
        }
188
        }
Lines 235-241 Link Here
235
                            "spnegoAuthenticator.ticketValidateFail"));
235
                            "spnegoAuthenticator.ticketValidateFail"));
236
                }
236
                }
237
                // Start again
237
                // Start again
238
                response.setHeader("WWW-Authenticate", "Negotiate");
238
                response.setHeader(AUTH_HEADER_NAME, "Negotiate");
239
                response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
239
                response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
240
                return false;
240
                return false;
241
            }
241
            }
Lines 247-253 Link Here
247
            if (log.isDebugEnabled()) {
247
            if (log.isDebugEnabled()) {
248
                log.debug(sm.getString("spnegoAuthenticator.ticketValidateFail"), e);
248
                log.debug(sm.getString("spnegoAuthenticator.ticketValidateFail"), e);
249
            }
249
            }
250
            response.setHeader("WWW-Authenticate", "Negotiate");
250
            response.setHeader(AUTH_HEADER_NAME, "Negotiate");
251
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
251
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
252
            return false;
252
            return false;
253
        } catch (PrivilegedActionException e) {
253
        } catch (PrivilegedActionException e) {
Lines 259-265 Link Here
259
            } else {
259
            } else {
260
                log.error(sm.getString("spnegoAuthenticator.serviceLoginFail"), e);
260
                log.error(sm.getString("spnegoAuthenticator.serviceLoginFail"), e);
261
            }
261
            }
262
            response.setHeader("WWW-Authenticate", "Negotiate");
262
            response.setHeader(AUTH_HEADER_NAME, "Negotiate");
263
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
263
            response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
264
            return false;
264
            return false;
265
        } finally {
265
        } finally {
Lines 280-286 Link Here
280
        }
280
        }
281
281
282
        // Send response token on success and failure
282
        // Send response token on success and failure
283
        response.setHeader("WWW-Authenticate", "Negotiate "
283
        response.setHeader(AUTH_HEADER_NAME, "Negotiate "
284
                + Base64.encodeBase64String(outToken));
284
                + Base64.encodeBase64String(outToken));
285
285
286
        if (principal != null) {
286
        if (principal != null) {

Return to bug 60720