Abyss: Identity Provider Federation

Abyss connects FerrisKey to external identity providers. Users can authenticate through Google, GitHub, Discord, or any custom OAuth2/OIDC provider, and FerrisKey handles the token exchange, user provisioning, account linking, and attribute mapping.

Why federation?

Federation meets users where they already have an identity. Rather than making them create yet another account, let them sign in with the Google or corporate credentials they already carry. FerrisKey sits in the middle as the broker, normalizing each provider’s format into one internal model.

Supported provider types

TypeStatusExamples
OAuth2SupportedGoogle, GitHub, Discord, any OAuth2 provider
OIDCSupportedAny OpenID Connect compliant provider
SAMLPlannedEnterprise IdPs such as Okta or Entra ID
LDAPPlannedActive Directory, OpenLDAP

SAML in the other direction already works

Signing in through an external SAML provider is what is planned here. FerrisKey acting as a SAML identity provider, so other applications can trust it, is shipped: see the SAML module.

Provider configuration

Providers are registered per realm, each with its full OAuth2 or OIDC configuration:

FieldDescription
nameDisplay name shown on the login page
provider_typeoauth2 or oidc
client_idOAuth2 client ID from the external provider
client_secretOAuth2 client secret (encrypted in storage)
authorization_urlProvider’s authorization endpoint
token_urlProvider’s token endpoint
userinfo_urlProvider’s UserInfo endpoint (optional)
scopesOAuth2 scopes to request (e.g., openid, email, profile)
enabledToggle the provider on/off without deleting it
configurationProvider-specific JSON config (e.g., tenant ID for Azure AD)

Secret encryption

Client secrets are encrypted before storage. They are never exposed through the admin API in plaintext.

Provider mappings

Mappings say how the provider’s attributes land on FerrisKey user fields:

External FieldInternal FieldRequired
emailemailYes
sub. (used for linking)Yes
preferred_usernameusernameNo
given_namefirstnameNo
family_namelastnameNo

A mapping can be marked required. When a required one is absent from the provider’s response, the federation flow fails rather than creating a half-filled user.

Common setups

Sign in with Google for a SaaS product

Configure a Google OAuth2 provider with scopes openid email profile. Users click “Sign in with Google”, authenticate at Google, and are redirected back to your app with FerrisKey tokens. New users are automatically provisioned.

Corporate SSO with Entra ID

Configure an OIDC provider pointing at your tenant’s endpoints. Employees authenticate with their corporate identity and receive FerrisKey tokens scoped to the right realm.

Several providers at once

Configure Google, GitHub, and Discord as providers on the same realm. Users choose their preferred provider on the login page. All three paths converge into the same FerrisKey user model with unified roles and permissions.

Account linking

A user who first signed in with Google can link a GitHub account later. Both external identities point at the same FerrisKey user, each tracked by its own federated credential.