Attributes — Sources

Attributes

A source automatically creates claims from data captured by a factor, such as the email address a user signs up with or the profile claims returned by an identity provider. Configured as bidirectional, it also works the other way round: creating a claim enrolls the user in the factor.

How it Works

  1. When a factor captures data, it produces a Capture Input event (capture-input, e.g. an email address) or Capture Claims event (capture-claims, the claims of an identity provider).
  2. For every enabled source on that factor, Quasr takes the value from the event and creates a claim for the user's attribute, validated against the attribute's configuration.
  3. A link is stored between the claim, the source and the enrollment it was captured from, and a Source Claim event (source-claim) reports the result.

Factors

Data is only captured when it's enabled on the factor (Capture Input or Capture Claims) and allowed in the request (capture_input / capture_claims, which default to true in the API; our Login UI asks the user first, see Interfaces — Consent & Data Notes):

Factor Captured Data (Claim) When Enabled By
Secret (username, email, phone, secret)The input (input)When an enrollment is createdCapture Input (config.capture_input), disabled by default
One-Time Password (OTP)The email address or phone number (input)When an enrollment is createdStorage Mode internal or external (config.storage_mode)
Identity Provider (IDP)The claims returned by the provider (e.g. email, given_name)At every login and signupCapture Claims (config.capture_claims), disabled by default
Password, TOTP, JWT--Not supported

Configuration

  • Attribute (attribute: string) - The ID of the attribute to create claims for. Required.
  • Factor (factor: string) - The ID of the factor to capture data from. Required.
  • Claim (claim: string) - Which value to use: input for the input captured by a secret or OTP factor, or the name of a claim of the identity provider, e.g. email or given_name. Nested claims (e.g. address.locality) aren't supported; source the whole address into a JSON attribute instead. Required.
  • Label (label: string) - Textual label for the source. Defaults to the attribute's label.
  • Status (status: string) - ENABLED or DISABLED. Only enabled sources are applied.
  • Bidirectional (config.bidirectional: boolean) - Whether creating a claim also enrolls the user in the factor, see Bidirectional. Only possible with claim input. Defaults to false.
  • Replace (config.replace: boolean) - Whether a newly captured value replaces the claims this source captured before for the same enrollment, instead of being added next to them, see Replace. Defaults to true for picture attributes (url:oidc1:picture) and false for all others.

Sources can be managed in the Admin UI, in the Sources tab of an attribute at https://{tenant_id}.admin.quasr.io/attributes/{attribute_id}/sources, or with the createSource, getSource, listSources, updateSource and deleteSource operations of the Management API:

  1. 1Only for identity providers: the name of the claim it returns; secret and OTP factors always use input
  2. 2Disabled by default: enable it to start creating claims
mutation {    createSource(input: {        attribute: "{email_attribute_id}",        factor: "{email_otp_factor_id}",        claim: "input",        label: "Email from OTP",        status: ENABLED,        config: { bidirectional: true }    }) {        id        status    }}

In the Agent API the create-source, get-source, list-sources, update-source and delete-source tools are used, passing the source as source_input.

Status & Conflicts

A sourced claim is ENABLED if the attribute doesn't require validation, or if the captured value is verified: e.g. an email address validated with an OTP, or an identity provider claim with {claim}_verified set to true (such as email_verified). Otherwise the claim is PENDING, and it's enabled automatically once the linked enrollment is validated (except for identity provider enrollments).

Following applies when the claim can't simply be created:

  • the user already has a claim with the same value: the existing claim is linked instead
  • the attribute is unique and another user has the value: no claim is created
  • the attribute is singular and the user already has a claim: no claim is created
  • the value is missing (MISSING_CLAIM) or doesn't match the attribute's type or regex (INVALID_CLAIM): no claim is created

Replace

By default every new value captured by a source is added as a new claim, so the user keeps all values ever captured, and all of them are included in tokens. For values where only the latest one matters, enable Replace on the source (enabled by default for sources on a picture attribute): after the new value is captured, the claims the source captured before for the same enrollment are removed, so the user keeps a single claim per enrollment.

  • A claim created by Quasr from the source is deleted (with a Delete Claim event, delete-claim), unless another source or enrollment is linked to it too.
  • A claim created by the user or an admin, which the source linked to because it had the same value, is kept: only the source's link to it is removed.
  • Locked and pending claims aren't deleted.
  • If the value didn't change, its existing claim is kept; any older claims of the source are still removed.

Use it in particular for profile pictures (picture) from identity providers. Facebook returns a different, signed picture URL on every login, which would otherwise add a claim per login; Google returns a new URL whenever the user changes their picture. A picture URL always shows the user's current picture, so older picture claims have no value of their own.

Bidirectional

A bidirectional source also works the other way round: when a claim is created for the attribute (e.g. by the user in the Account UI or by an admin), the user is enrolled in the source's factor with the claim's value, and the claim and enrollment are linked. For example, an email address added as attribute becomes an email OTP enrollment the user can log in with.

  • The enrollment is enabled right away if the factor doesn't require validation, or if the claim is already validated; otherwise it's pending, and it's enabled once the claim is enabled (and vice versa).
  • The outcome is reported in a Source Enrollment event (source-enrollment).

For example, users log in with a username (score 1) and a password (score 2), and the email attribute has a bidirectional source to an email OTP factor (score 2). Someone who only knows the username can then, depending on the configuration:

Email Attribute Email OTP Factor Result Why
Score 1No validation requiredUnsafeAdding their own email address creates an enabled OTP enrollment, so they can log in with username + OTP (score 3).
Score 1Validation required, Allow Pending enabledUnsafeThe OTP sent to their own address validates the pending enrollment during login.
Score 1Validation required, Allow Pending disabled (default)SafeThe enrollment stays pending and can't be used to log in until the claim is validated.
Score 3 (full login)AnySafeOnly fully logged-in users can add an email address.
RestrictedAnySafeUsers can't add the attribute themselves; only admins and the system can.

In short: give the attribute a score of at least a full login or make it restricted, and keep Require Validation enabled and Allow Pending disabled on factors created from attributes.

Email Setup

A very common setup links one email attribute to two factors: an email OTP factor, which proves the user owns the address, and an email (username) factor, to identify the user by email. Configure it as follows:

  • Email attribute - unique, and requires validation.
  • Email OTP factor - storage mode internal, so it captures the email address, with a source on the email attribute with claim input, bidirectional. The email address is captured when the user enrolls, and validated by the OTP.
  • Email username factor - restricted, with a bidirectional source on the email attribute (claim input). Users can't enroll in it themselves: the enrollment is created from the email claim, and enabled once the claim is validated with the OTP.
  1. 1input: the email address entered in the factor; for an identity provider the name of its claim
  2. 2From the restricted email username factor: creates its enrollment from the email claim

An email address then flows through the setup as follows:

  1. The user enrolls in the email OTP factor (at signup or in the Account UI); the source captures the email address as a pending claim.
  2. The user enters the OTP, which enables the OTP enrollment and, through the link, the email claim.
  3. The bidirectional source on the email username factor creates an enrollment from the claim, enabled together with the claim.
  4. Email addresses added as attribute (e.g. in the Account UI) work the other way round: they create a pending OTP enrollment, and an OTP to validate them.

Links connect a claim with the source and enrollment it was sourced from (or created). They show where a claim came from, and are used to enable claims and enrollments together. OTP factors in internal storage mode also use the link to find the email address or phone number to send the OTP to.

Links can be retrieved with the getLink and listLinks operations of the Management API (get-link and list-links tools of the Agent API), and are shown in the Admin UI and Account UI. See View.

Deleting a source, claim or enrollment deletes its links, and deleting a factor deletes its sources. Claims and enrollments themselves are never deleted because their link or source is. Only a source with Replace enabled deletes claims, namely the ones it captured before.

Source Check

An identity provider factor can refer to one of its sources (config.source), which is then checked on every login and signup with the provider. The provider must return the source's claim with a valid value, and if the attribute is unique, an identity whose value already belongs to another account can't sign up or be linked: the user has to log in to that existing account instead. This prevents users from ending up with two accounts for the same email address. See Factors — IDP for all scenarios and their responses.

Examples

  • Email address from OTP - Create a source on the email attribute with your email OTP factor and claim input. The email address a user signs up with is stored as claim, and enabled once the OTP is validated. Make it bidirectional so email addresses users add in the Account UI can also be used to log in, taking the scores into account. See Email Setup.
  • Profile from Google - Enable Capture Claims on the Google factor and create a source per claim, e.g. given_name for the given name attribute. See Factors — IDP.
  • Profile picture from Facebook or Google - Create a source with claim picture on the picture attribute (url:oidc1:picture) and keep Replace enabled (the default for picture attributes), so the user keeps a single, current picture claim. For Google, add profile to the factor's scope.

All related events (capture-input, capture-claims, source-claim, source-enrollment) are listed in the event catalog.

2026.11.22 | © Copyright 2026 Quasr BV