@Override public GeoServerSecurityFilter createFilter(SecurityNamedServiceConfig config) { return new GeoServerCredentialsFromRequestHeaderFilter(); }
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String cacheKey = authenticateFromCache(this, (HttpServletRequest) request); if (SecurityContextHolder.getContext().getAuthentication() == null) { doAuthenticate((HttpServletRequest) request, (HttpServletResponse) response); Authentication postAuthentication = SecurityContextHolder.getContext().getAuthentication(); if (postAuthentication != null && cacheKey != null) { if (cacheAuthentication(postAuthentication, (HttpServletRequest) request)) { getSecurityManager() .getAuthenticationCache() .put(getName(), cacheKey, postAuthentication); } } } request.setAttribute(GeoServerSecurityFilter.AUTHENTICATION_ENTRY_POINT_HEADER, aep); chain.doFilter(request, response); }
String username = parseHeader(usHeader, userNameRegex); String password = parseHeader(pwHeader, passwordRegex); if (username == null && password == null) { return null; buff.append(getName()); String digestString = null; try {
String us = parseHeader(usHeader, userNameRegex); String pw = parseHeader(pwHeader, passwordRegex); if (us == null || pw == null) { return; Authentication auth = null; try { auth = getSecurityManager().authenticationManager().authenticate(result); } catch (ProviderNotFoundException e) { LOGGER.log(Level.WARNING, "couldn't to authenticate user:" + us);