Class SecurityRealm<T>

java.lang.Object
net.coder966.spring.multisecurityrealms.model.SecurityRealm<T>

public abstract class SecurityRealm<T> extends Object
  • Constructor Details

    • SecurityRealm

      public SecurityRealm(String rolePrefix, String loginUrl, String logoutUrl)
  • 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

      public abstract List<org.springframework.security.web.util.matcher.RequestMatcher> getPublicApis()
      If you want, you can define endpoints here and they will be made publicly available without authentication.
      Returns:
      A list of request matchers