Class SecurityRealm<T>
java.lang.Object
net.coder966.spring.multisecurityrealms.model.SecurityRealm<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SecurityRealmAuthentication<T>authenticate(jakarta.servlet.http.HttpServletRequest request, String step, SecurityRealmAuthentication<T> previousStepAuth) This is the authentication handler.abstract List<org.springframework.security.web.util.matcher.RequestMatcher>If you want, you can define endpoints here and they will be made publicly available without authentication.
-
Constructor Details
-
SecurityRealm
-
-
Method Details
-
authenticate
public abstract SecurityRealmAuthentication<T> authenticate(jakarta.servlet.http.HttpServletRequest request, String step, SecurityRealmAuthentication<T> previousStepAuth) This is the authentication handler. Login requests will be forwarded here. It supports multi factor authentication (MFA), for example 2FA with OTP etc... If the authentication is successful, return a SecurityRealmAuthentication. To indicate the user must go through another factor of authentication, pass that step name to the constructor of SecurityRealmAuthentication. When the user authenticate for that additional step, the same handler will be called with the appropriate step name.- Parameters:
request- The request.step- Step name. Null for the first step.previousStepAuth- The current user authentication. Null for the first step.- Returns:
- the user authentication object in case of successful authentication.
-
getPublicApis
If you want, you can define endpoints here and they will be made publicly available without authentication.- Returns:
- A list of request matchers
-