Connectors

On this page
Starter plan required

This feature requires at least a Starter plan.

Play Available since 1.18.0

Connectors link FusionAuth to other sources of user data. A Connector does one of the following:

  • Authenticates users against the external data source.
  • Authenticates users and migrates the users from the external data source into FusionAuth.

FusionAuth offers the following Connectors:

When you need a Connector that FusionAuth doesn't offer, search the open feature requests in the FusionAuth issues repository. Vote or comment on an existing request, or open a new request.

To manage Connectors in the Admin UI, navigate to Settings -> Connectors . You can also use the Connectors APIs.

The Connectors list.
The Connectors list.

Data Flow#

Your users and applications can't tell that a Connector is in use. A login through a Connector looks the same as a login against the FusionAuth user datastore.

The following diagram shows the data flow for an Authorization Code grantAn OAuth 2.0 grant type in which a client exchanges an authorization code for tokens. with a Connector:

Your Identity DatastoreJSON API or LDAP ConnectionFusionAuthAppUser/BrowserYour Identity DatastoreJSON API or LDAP ConnectionFusionAuthAppUser/BrowserView Initial PageClick LoginRedirect User To FusionAuthRequest Login PageReturn Login PageProvides CredentialsProvides CredentialsProvides CredentialsVerifies CredentialsReturns User DataReturns DataRedirect With Authorization CodeRequest Redirect URIRequest TokensReturn Tokens
Your Identity DatastoreJSON API or LDAP ConnectionFusionAuthAppUser/BrowserYour Identity DatastoreJSON API or LDAP ConnectionFusionAuthAppUser/BrowserView Initial PageClick LoginRedirect User To FusionAuthRequest Login PageReturn Login PageProvides CredentialsProvides CredentialsProvides CredentialsVerifies CredentialsReturns User DataReturns DataRedirect With Authorization CodeRequest Redirect URIRequest TokensReturn Tokens

Login with the Authorization Code grant through a Connector.

The user enters credentials on the FusionAuth login page. FusionAuth passes the credentials to the Connector, and the Connector checks the credentials against your identity datastore. The Connector returns the user data to FusionAuth. FusionAuth then completes the login as usual.

Authentication#

When a Connector authenticates users without migrating the users, the external data source stays the system of record. Every login checks the external data source, and every login replaces user data such as registrations and group memberships. FusionAuth also deletes the user's multi-factor authentication methods at each login. For more information, see the system of record sections of the Generic Connector and LDAP Connector pages.

Authentication through a Connector works like an Identity Provider without the redirects. With a Connector, the administrator chooses the data source, and the user doesn't. A Connector can also map extra profile data from the data source into the FusionAuth user. The data source doesn't need to implement OIDC or SAML. Any data source that speaks LDAPA protocol for reading and authenticating users in a directory server, such as Active Directory. FusionAuth connects to a directory server through an LDAP Connector. or HTTP works.

Caution

A Connector can create users with registrations and roles that grant access to the FusionAuth Admin UI.

Migration#

When a Connector migrates users, FusionAuth copies each user from the external data source at the user's first successful login. Later logins authenticate against FusionAuth. FusionAuth doesn't consult the external data source for that user again, so later changes in the external data source don't reach FusionAuth.

Migration through a Connector supports a phased migration, where each user migrates at the user's first login. After a user migrates, make changes to the user's data, such as group memberships, in FusionAuth. When enough users have migrated, shut off the old system and remove the Connector configuration. For more information, see Slow Migration.

User Fields#

The Generic Connector gets a FusionAuth user object from your API. The LDAP Connector builds the user object in the LDAP Reconcile lambda. FusionAuth handles the user object from both Connectors the same way.

Required Fields#

Every user object must include the following fields:

  • user.id: a FusionAuth-compatible UUID.
  • At least one of user.email, user.username, or user.phoneNumber.

When a required field is missing, FusionAuth discards the user, and the login fails.

When the Connector authenticates users without migrating the users, return the same user.id at every login. FusionAuth then recognizes the user even when the user's email address, username, or phone number changes. Use a directory attribute that holds a UUID, or an attribute that you can translate to a UUID. When the Connector migrates users, FusionAuth doesn't consult the data source again, so a random UUID works.

Fields FusionAuth Stores#

FusionAuth stores the profile fields of the user object, such as user.firstName and user.data. Use user.data for application or migration data, such as the migration date for later searches.

The following fields need extra care:

  • user.registrations: the applications that the user can access. Add at least the application that the user logs into. Each applicationId must match an existing Application, and each role must match a role name on that Application. FusionAuth also stores the other registration fields, such as data and timezone.
  • user.memberships: the groups that the user belongs to. Each groupId must match an existing Group in the tenant.
  • user.verified and user.verifiedInstant: when user.verified is true, FusionAuth marks the user's email address and phone number as verified. FusionAuth reads these fields only at the user's first login.
  • user.passwordChangeRequired: when the Connector migrates the user, FusionAuth asks the user to change the password at the first login. When the Connector doesn't migrate the user, FusionAuth ignores the field.
  • user.twoFactor.methods: when the Connector migrates the user, FusionAuth stores the multi-factor authentication methods and challenges the user at login. FusionAuth generates the method Ids.

When a registration or membership references an Id that doesn't exist, FusionAuth discards the user, and the login fails. FusionAuth writes the validation errors to System -> Event Log .

Return MFA methods only for migrated users

When the Connector doesn't migrate the user, leave out user.twoFactor.methods. FusionAuth stores the methods at the first login, and every later login fails validation because the methods already exist.

Fields FusionAuth Sets#

FusionAuth sets the following fields and ignores the values in the user object:

  • user.password: FusionAuth stores the password that the user entered at login. A password in the user object doesn't work for login.
  • user.passwordLastUpdateInstant: the time of the first login.
  • user.tenantId: the tenant of the application that the user logs into.
  • user.connectorId: the Id of the Connector, or the Id of the FusionAuth Connector when the Connector migrates the user.
  • user.active: true at the first login. Later logins keep the stored value, so a user that you deactivate in FusionAuth can't log in.
  • user.insertInstant and user.lastUpdateInstant: the times that FusionAuth creates and updates the user.
  • user.identities: FusionAuth builds the identities from user.email, user.username, and user.phoneNumber.

Connector Policies#

A Connector policy enables a Connector for a tenant. Each tenant lists its Connector policies in order, and each Connector appears at most once in the list.

The following screenshot shows two custom Connectors enabled for the Default TenantThe Tenant that FusionAuth creates during installation. You can't delete the Default Tenant, which hosts the FusionAuth Admin UI Application., followed by the FusionAuth Connector:

The Tenant Connector policy configuration tab.
The Tenant Connector policy configuration tab.

FusionAuth applies the Connector policies in order at a user's first login. In the screenshot, FusionAuth handles first-time users as follows:

  • For a user with an email address at example.com, FusionAuth tries the Active Directory Connector first. When the Active Directory Connector doesn't find the user, FusionAuth tries the Legacy User API Connector, then the FusionAuth Connector.
  • For a user with an email address at any other domain, FusionAuth tries the Legacy User API Connector first, then the FusionAuth Connector.

At the first successful login, the Connector creates the user in FusionAuth. Later logins authenticate the user against the same Connector. When you delete a Connector, FusionAuth authenticates the Connector's users against the Connectors in the current policy order.

Domains#

Set the domains of a Connector policy to one of the following values:

  • *, which applies the policy to all users.
  • One or more email domains, such as example.com or piedpiper.com. Put each domain on its own line.

A policy with email domains applies only to users who log in with an email address.

Connectors and Identity Providers#

Connectors share many features with Identity Providers. Both connect FusionAuth to an external system of record for user identity.

The following questions help you choose:

  • When you want to migrate users into FusionAuth, use a Connector.
  • When your external system supports a standard such as OIDC or SAML, use an Identity Provider.
  • When your external system supports only LDAP, use a Connector.
  • When the external system stays the system of record for the users, an Identity Provider is usually the better choice.
  • When your identity store has no standard way to share identity data, use a Connector.