Record Class AuthMethods

java.lang.Object
java.lang.Record
com.onec.auth.spi.AuthMethods
Record Components:
passwordEnabled - whether interactive username/password login is available (the in-memory mode)
providers - the SSO options to offer, possibly empty
logoutUrl - where the client navigates to log out; non-null only when logout requires a server round-trip (OIDC RP-initiated logout), null otherwise
mode - the active backend: in-memory, oidc, or resource-server

public record AuthMethods(boolean passwordEnabled, List<SsoProvider> providers, String logoutUrl, String mode) extends Record
Describes how a user may authenticate, so the login screen can be composed server-side rather than hardcoded in the client. Produced by an AuthMethodsProvider and consumed by the UI module to build a server-driven (DivKit) login surface.

Deliberately plain data with no Spring / Spring Security types, because it crosses the onec-framework seam shared by the auth and UI modules.

  • Constructor Details

    • AuthMethods

      public AuthMethods(boolean passwordEnabled, List<SsoProvider> providers, String logoutUrl, String mode)
      Creates an instance of a AuthMethods record class.
      Parameters:
      passwordEnabled - the value for the passwordEnabled record component
      providers - the value for the providers record component
      logoutUrl - the value for the logoutUrl record component
      mode - the value for the mode record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • passwordEnabled

      public boolean passwordEnabled()
      Returns the value of the passwordEnabled record component.
      Returns:
      the value of the passwordEnabled record component
    • providers

      public List<SsoProvider> providers()
      Returns the value of the providers record component.
      Returns:
      the value of the providers record component
    • logoutUrl

      public String logoutUrl()
      Returns the value of the logoutUrl record component.
      Returns:
      the value of the logoutUrl record component
    • mode

      public String mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component