Class FederatedIdentityProps

Assembly: redb.Identity.Core.dll

H8 (v1.0 DoD §4): one federated identity link between a local user and an external IdP.
One row per (user, provider) tuple. Stored in PROPS with:
RedbObject.key = userId — fast filter for "all my federations". = "{providerId}:{externalSub}" — unique per scheme
via [RedbUnique] (V4-UNIQUE), enables the O(1) reverse lookup at federated
callback time. Historical note: the doc used to claim a partial unique index on
value_string that no code ever created — duplicates were possible until F2;
value_string is a transition mirror now.

Replaces the legacy dictionary which only
supported a single reverse-lookup key per user (the UserProps.value_string was
overwritten by the most-recently-linked provider, breaking lookup for older links).
is kept as a denormalized read-model mirror
for backwards compatibility with code paths that already consumed it.

[RedbScheme("identity.federated_identity")]
public class FederatedIdentityProps

Inheritance

Object→FederatedIdentityProps

Properties

ExternalDisplayName

Display name reported by the IdP at the time of the most recent login.

public string? ExternalDisplayName { get; set; }

ExternalEmail

Email reported by the IdP at the time of the most recent login (may be null).

public string? ExternalEmail { get; set; }

ExternalSub

External subject (the IdP's stable user identifier, e.g. sub for OIDC).

public string ExternalSub { get; set; }

LastLoginAt

UTC timestamp of the last successful federated login through this link.

public DateTimeOffset? LastLoginAt { get; set; }

LinkedAt

UTC timestamp when the link was first established.

public DateTimeOffset LinkedAt { get; set; }

LinkKey

Reverse-lookup key "{ProviderId}:{ExternalSub}" — unique per scheme via

public string? LinkKey { get; set; }

ProviderId

Provider id (e.g. google, azure-ad, github). Lowercase.

public string ProviderId { get; set; }

Methods

MakeLinkKey(string, string)

The one place the composite key format lives.

public static string MakeLinkKey(string providerId, string externalSub)