Compare commits
No commits in common. '2828c03dcac60a724cfa9ce97c67a7a3019b86c9' and 'bcb46819d096ca4ab3b18db81de320e8bed01099' have entirely different histories.
2828c03dca
...
bcb46819d0
5 changed files with 864 additions and 309 deletions
@ -1,54 +0,0 @@ |
|||||||
package de.superx.saiku; |
|
||||||
|
|
||||||
import java.io.IOException; |
|
||||||
|
|
||||||
import jakarta.servlet.FilterChain; |
|
||||||
import jakarta.servlet.ServletException; |
|
||||||
import jakarta.servlet.ServletRequest; |
|
||||||
import jakarta.servlet.ServletResponse; |
|
||||||
import jakarta.servlet.http.HttpServletRequest; |
|
||||||
|
|
||||||
import org.apache.log4j.Logger; |
|
||||||
import org.springframework.context.ApplicationContext; |
|
||||||
import org.springframework.security.web.authentication.AnonymousAuthenticationFilter; |
|
||||||
import org.springframework.security.core.context.SecurityContextHolder; |
|
||||||
import org.springframework.web.context.WebApplicationContext; |
|
||||||
|
|
||||||
import de.superx.servlet.RequestParameter; |
|
||||||
import de.superx.servlet.ServletBasics; |
|
||||||
import de.superx.servlet.UserInitializer; |
|
||||||
|
|
||||||
public class SuperXLDAPAnmeldungFilter extends AnonymousAuthenticationFilter { |
|
||||||
public static Logger logger = Logger.getLogger(SuperXLDAPAnmeldungFilter.class); |
|
||||||
|
|
||||||
public SuperXLDAPAnmeldungFilter(String key) { |
|
||||||
super(key); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
|
||||||
throws IOException, ServletException { |
|
||||||
HttpServletRequest req=(HttpServletRequest) request; |
|
||||||
if(SecurityContextHolder.getContext().getAuthentication()!=null |
|
||||||
&& req.getSession().getAttribute("user")==null) |
|
||||||
{ |
|
||||||
String kennungImRequest = SecurityContextHolder.getContext().getAuthentication().getName(); |
|
||||||
if (kennungImRequest != null ) { |
|
||||||
logger.debug("Gastanmeldung kennung=gast* im Request gefunden"); |
|
||||||
UserInitializer ui; |
|
||||||
try { |
|
||||||
/*ui = new UserInitializer((HttpServletRequest) request); |
|
||||||
ui.perform(null, (ApplicationContext) request.getServletContext() |
|
||||||
.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE)); |
|
||||||
logger.info("Gastanmeldung als " + ui.getUser().getName()+" erfolgreich");*/ |
|
||||||
} catch (Exception e) { |
|
||||||
e.printStackTrace(); |
|
||||||
logger.error("Gastanmeldung fehlgeschlagen " + e); |
|
||||||
throw new ServletException("Gastanmeldung fehlgeschlagen " + e); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
chain.doFilter(request, response); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
Binary file not shown.
Loading…
Reference in new issue