I am relatively new to the Spring Framework and Spring security.
I have used a custom authentication scheme, HTML:
All above are great and perfect solutions. But I have used a workaround kind of solution which works perfectly fine. Used multitenant id for ThreadLocal
package com.mypackage.servlet;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import org.springframework.util.Assert;
public class ThreadLocalContextUtil implements Filter{
private static final ThreadLocal
spring security xml
......
Access request object in your Authentication Class
HttpServletRequest currRequest = (HttpServletRequest) ThreadLocalContextUtil.getTenantId();
Then use the request object to get your custom parameters