Class AuthDetails

java.lang.Object
io.jmix.securityflowui.authentication.AuthDetails

public class AuthDetails extends Object
Class contains authentication information.

Example usage:

 @Autowired
 private LoginViewSupport authenticator;

 private void doLogin(String username, String password) {
     loginViewSupport.authenticate(
         AuthDetails.of(event.getUsername(), event.getPassword())
     );
 }
 
See Also:
  • Field Details

    • username

      protected String username
    • password

      protected String password
    • locale

      protected Locale locale
    • timeZone

      protected TimeZone timeZone
    • rememberMe

      protected boolean rememberMe
  • Method Details

    • of

      public static AuthDetails of(String username, String password)
      Creates a new instance with authentication credentials.
      Parameters:
      username - user login
      password - user password
      Returns:
      new instance
    • getUsername

      public String getUsername()
      Returns:
      user login
    • getPassword

      public String getPassword()
      Returns:
      user password
    • isRememberMe

      public boolean isRememberMe()
      Returns:
      true if rememberMe is enabled, false otherwise
    • withRememberMe

      public AuthDetails withRememberMe(boolean rememberMe)
      Sets rememberMe enabled. If rememberMe is enabled, the user can pass authentication without entering credentials.
      Parameters:
      rememberMe - whether rememberMe should be used
      Returns:
      current instance
    • getLocale

      @Nullable public Locale getLocale()
      Returns:
      a locale or null if not set
    • withLocale

      public AuthDetails withLocale(@Nullable Locale locale)
      Sets user locale to be used in application.
      Parameters:
      locale - a locale
      Returns:
      current instance
    • getTimeZone

      @Nullable public TimeZone getTimeZone()
      Returns:
      a timezone or null if not set
    • withTimeZone

      public AuthDetails withTimeZone(@Nullable TimeZone timeZone)
      Sets user timezone to be used in application.
      Parameters:
      timeZone - a timezone
      Returns:
      current instance