|
|
@ -49,6 +49,9 @@ public class BasicAuthAuthenticator implements WebappAuthenticator {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public boolean canHandle(Request request) {
|
|
|
|
public boolean canHandle(Request request) {
|
|
|
|
|
|
|
|
if (!isSupportsAuthentication(request)) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
MessageBytes authorization =
|
|
|
|
MessageBytes authorization =
|
|
|
|
request.getCoyoteRequest().getMimeHeaders().getValue(Constants.HTTPHeaders.HEADER_HTTP_AUTHORIZATION);
|
|
|
|
request.getCoyoteRequest().getMimeHeaders().getValue(Constants.HTTPHeaders.HEADER_HTTP_AUTHORIZATION);
|
|
|
|
if (authorization != null) {
|
|
|
|
if (authorization != null) {
|
|
|
@ -156,4 +159,9 @@ public class BasicAuthAuthenticator implements WebappAuthenticator {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isSupportsAuthentication(Request request) {
|
|
|
|
|
|
|
|
String param = request.getContext().findParameter("basicAuth");
|
|
|
|
|
|
|
|
return (param == null || !Boolean.parseBoolean(param));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|