Record Class SsoProvider

java.lang.Object
java.lang.Record
su.onno.auth.spi.SsoProvider
Record Components:
id - the OIDC client registration id (e.g. keycloak, zitadel), or the connector's provider id (e.g. telegram)
label - human-readable provider name (the client name, falling back to the id), wrapped by the UI's "Continue with {provider}" framing unless buttonLabel overrides it
authorizationUrl - where the browser navigates to start login (/oauth2/authorization/{id} for OIDC, or the connector's own start endpoint for an additive provider)
iconUrl - optional URL of the provider's brand logo for the button, rendered on the right of the label, so a connector can give its "Log in with X" button a real mark. The connector that owns the provider serves the asset (e.g. /api/auth/telegram/logo.svg); the framework only renders the URL it is given. null renders a label-only button.
monochrome - how the iconUrl is painted: false (the default) renders the logo as-is, keeping its brand colors (e.g. a full-color badge); true treats it as a single-color glyph and tints it to the app's accent (primary) color, so the mark picks up the theme — an orange primary paints it orange, matching the primary-filled password button — and still reads in both light and dark (the default neutral primary is near-black / near-white). On a primary-filled SSO button the mark uses the on-primary page color instead, for contrast against the fill. Use true for a single-color brand glyph supplied as bare paths. Ignored when iconUrl is null.
buttonLabel - optional full, ready-to-render button label that replaces the "Continue with {provider}" framing entirely — set this when the label is already a complete, localized phrase (e.g. the Russian "Войти через Telegram") so it isn't double-wrapped into a mixed-language string. null/blank uses the default framing.

public record SsoProvider(String id, String label, String authorizationUrl, String iconUrl, boolean monochrome, String buttonLabel) extends Record
A single sign-on option offered on the login screen — typically one OIDC client registration, or an additive non-OIDC identity provider contributed by a connector (see AuthMethodsContributor).

Part of the auth↔UI seam (see AuthMethodsProvider): plain data so the UI module can render an SSO button without depending on the auth module or Spring Security.

  • Constructor Details

    • SsoProvider

      public SsoProvider(String id, String label, String authorizationUrl)
      Convenience constructor for a provider without a button icon — equivalent to passing iconUrl = null. Kept so existing callers (e.g. OIDC registrations and connectors that predate icon support) compile and behave unchanged.
    • SsoProvider

      public SsoProvider(String id, String label, String authorizationUrl, String iconUrl)
      Convenience constructor for a provider with a full-color brand logo and the default "Continue with {provider}" framing — equivalent to monochrome = false and no buttonLabel. Kept so callers that adopted the earlier 4-arg form keep compiling.
    • SsoProvider

      public SsoProvider(String id, String label, String authorizationUrl, String iconUrl, boolean monochrome, String buttonLabel)
      Creates an instance of a SsoProvider record class.
      Parameters:
      id - the value for the id record component
      label - the value for the label record component
      authorizationUrl - the value for the authorizationUrl record component
      iconUrl - the value for the iconUrl record component
      monochrome - the value for the monochrome record component
      buttonLabel - the value for the buttonLabel 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • label

      public String label()
      Returns the value of the label record component.
      Returns:
      the value of the label record component
    • authorizationUrl

      public String authorizationUrl()
      Returns the value of the authorizationUrl record component.
      Returns:
      the value of the authorizationUrl record component
    • iconUrl

      public String iconUrl()
      Returns the value of the iconUrl record component.
      Returns:
      the value of the iconUrl record component
    • monochrome

      public boolean monochrome()
      Returns the value of the monochrome record component.
      Returns:
      the value of the monochrome record component
    • buttonLabel

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