Package su.onno.auth.spi
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 unlessbuttonLabeloverrides it- 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.nullrenders a label-only button.monochrome- how theiconUrlis painted:false(the default) renders the logo as-is, keeping its brand colors (e.g. a full-color badge);truetreats 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. Usetruefor a single-color brand glyph supplied as bare paths. Ignored wheniconUrlis null.- 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 Summary
ConstructorsConstructorDescriptionSsoProvider(String id, String label, String authorizationUrl) Convenience constructor for a provider without a button icon — equivalent to passingiconUrl = null.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 tomonochrome = falseand nobuttonLabel.SsoProvider(String id, String label, String authorizationUrl, String iconUrl, boolean monochrome, String buttonLabel) Creates an instance of aSsoProviderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthorizationUrlrecord component.Returns the value of thebuttonLabelrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.iconUrl()Returns the value of theiconUrlrecord component.id()Returns the value of theidrecord component.label()Returns the value of thelabelrecord component.booleanReturns the value of themonochromerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SsoProvider
Convenience constructor for a provider without a button icon — equivalent to passingiconUrl = null. Kept so existing callers (e.g. OIDC registrations and connectors that predate icon support) compile and behave unchanged. -
SsoProvider
Convenience constructor for a provider with a full-color brand logo and the default"Continue with {provider}"framing — equivalent tomonochrome = falseand nobuttonLabel. 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 aSsoProviderrecord class.- Parameters:
id- the value for theidrecord componentlabel- the value for thelabelrecord componentauthorizationUrl- the value for theauthorizationUrlrecord componenticonUrl- the value for theiconUrlrecord componentmonochrome- the value for themonochromerecord componentbuttonLabel- the value for thebuttonLabelrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
label
Returns the value of thelabelrecord component.- Returns:
- the value of the
labelrecord component
-
authorizationUrl
Returns the value of theauthorizationUrlrecord component.- Returns:
- the value of the
authorizationUrlrecord component
-
iconUrl
Returns the value of theiconUrlrecord component.- Returns:
- the value of the
iconUrlrecord component
-
monochrome
public boolean monochrome()Returns the value of themonochromerecord component.- Returns:
- the value of the
monochromerecord component
-
buttonLabel
Returns the value of thebuttonLabelrecord component.- Returns:
- the value of the
buttonLabelrecord component
-