com.netgrif.application.engine.configuration.authentication.providers.NetgrifAuthenticationProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of application-engine Show documentation
Show all versions of application-engine Show documentation
System provides workflow management functions including user, role and data management.
package com.netgrif.application.engine.configuration.authentication.providers;
import com.netgrif.application.engine.auth.service.interfaces.ILoginAttemptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import javax.servlet.http.HttpServletRequest;
public abstract class NetgrifAuthenticationProvider implements AuthenticationProvider {
@Autowired
protected UserDetailsService userDetailsService;
@Autowired
protected HttpServletRequest request;
@Autowired
protected ApplicationEventPublisher publisher;
@Autowired
protected ILoginAttemptService loginAttemptService;
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
return null;
}
public abstract Authentication authenticate(Authentication authentication);
public abstract boolean supports(Class> authentication);
protected String getClientIP() {
String xfHeader = request.getHeader("X-Forwarded-For");
if (xfHeader == null) {
return request.getRemoteAddr();
}
return xfHeader.split(",")[0];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy